Originally Posted by Duugu
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:
frame:SetScript("OnDragStop", function(self) self:StopMovingOrSizing() self.x = self:GetLeft() self.y = (self:GetTop() - self:GetHeight()) self:ClearAllPoints() self:SetPoint("BOTTOMLEFT", self:GetParent(), "BOTTOMLEFT", self.x, self.y) 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:
function PowaAurasOptions:FrameMouseUp(frame, button)
frame.x = frame:GetLeft()
frame.y = frame:GetBottom()
frame:StopMovingOrSizing()
end