Thread Tools Display Modes
Prev Previous Post   Next Post Next
01-25-14, 03:05 PM   #35
Resike
A Pyroguard Emberseer
AddOn Author - Click to view addons
Join Date: Mar 2010
Posts: 1,290
Originally Posted by Duugu View Post
Nice one. I'll definitly bookmark this for later use.



My guess is that's due to the way the moving stuff works. It re-anchors the frame all the time (to the nearest anchor point or whatever ... I don't know ). If you anchor a frame to center/center and move it to the left then it will be re-anchored to left/left or something.

You can work around this annoying behavior with re-anchoring it to the desired anchor on OnDragStop.

Lua Code:
  1. frame:SetScript("OnDragStop", function(self)
  2.         self:StopMovingOrSizing()
  3.         self.x = self:GetLeft()
  4.         self.y = (self:GetTop() - self:GetHeight())
  5.         self:ClearAllPoints()
  6.         self:SetPoint("BOTTOMLEFT", self:GetParent(), "BOTTOMLEFT", self.x, self.y)
  7.     end)
I actually did the same thing ondragstop, however i havn't repointed the frame just saved the coords, but i don't think reparenting is needed there:

Lua Code:
  1. function PowaAurasOptions:FrameMouseUp(frame, button)
  2.     frame.x = frame:GetLeft()
  3.     frame.y = frame:GetBottom()
  4.     frame:StopMovingOrSizing()
  5. end
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Resize frame


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