Edit Mode Expanded

Edit Mode Expanded

662k Downloads

Frame position error when anchor is not "BOTTOMLEFT"

Etern213 opened this issue ยท 1 comments

commented

My English is not good, I will try my best to describe it clearly, sorry.

function lib:RegisterFrame allow us to register a frame with custom anchorTo and anchorPoint, and I notice that when I register a frame like this EME:RegisterFrame(myFrame, "TEST", myDB, UIParent, "CENTER"), and EME cannot positon it correctly in "OnDragStop" script.

I review the code and find that the problem occured in function getOffsetXY, It seems that this function is a unfinish work. I rewrite it and open a pull request #77, you can test it and merge it if it don't have problem.


Add: I remove the code below in the beginning of getOffsetXY, because I find that we need this calculate evenif we use UIParent as anchor.

if frame.EMEanchorTo == UIParent then
    return x, y
end

@teelolws

commented

Looks good. I was struggling with that code and couldn't get it right.