Thread Tools Display Modes
Prev Previous Post   Next Post Next
05-12-17, 06:33 AM   #1
VincentSDSH
Non-Canadian Luzer!
 
VincentSDSH's Avatar
AddOn Author - Click to view addons
Join Date: Jun 2006
Posts: 350
:SetPoint(), :GetPoint(), & :GetAspirin()

Lua Code:
  1. region:SetPoint(point, relativeTo, relativePoint, offset_x, offset_y)
Lua Code:
  1. point, relativeTo, relativePoint, offset_x, offset_y = region:GetPoint(n)

If :SetPoint() is used to set one (or more) points on a region and said region is then repositioned via drag, :GetPoint() acts as if :ClearAllPoints() has been run, towit, UIParent is the new relativeTo and only 1 point is set.

This...this seems to be bloody absurd, even Microsoftian, behavior. Logically, since each point already has a set of rel characteristics, those would be retained and each point's offset coords updated. Instead, you have relationship-breaking behavior.

I could, frankly, forgive this if there was a API for getting relative offsets between two points, even if restricted to UIParent points, a sort of...
Lua Code:
  1. dx, dy = GetRelOffset(frame, framePoint, UIParent_relPoint, UIParent_offset_x, UIParent_offfset_y)
...but I can't find one.

To reassert an updated and proper relative-to/offset relationship, you'd need to crawl recursively though the :GetParent() chain, checking points and offsets, heights/widths, etc, and try to work back to UIParent, then find an offset. I...call me crazy but that seems a tad excessive.

Am I missing something stunningly obvious or should I just bend over and take it like a tax audit?

(Since 'why' is often asked: Series of frames anchored to blizzardUI frames which may, or may not, be in their original positions; when created, the frames position relative to their respective blizzardUI frames; when adjusted, however, :GetPoint() won't return an offset to the original relativeTo region so the coords can't be used with the relativeTo region which, naturally, means that when the associated blizzardUI frames are moved, the custom frames stay put rather than move w/ the blizzardUI frames as they should.)
__________________
AddonsExecutive Assistant User Configurable To-Do ListLegible Mail Choose the Font for Your Mail
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » :SetPoint(), :GetPoint(), & :GetAspirin()


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off