The other idea is that each time the user changes the anchor, run the function that sets or gets the x and y offsets immediately after, within the options to change the anchor.
This means you will need to rewrite slightly:
Lua Code:
-- this is the get for the anchor option code
get = function()
local x, y = MyAddOn:GetXYOffsets()
-- or return GetXYOffsets() if the function is local to file scope
-- update your anchor
-- followed by updating your x, y offsets
end
function:MyAddOn:GetXYOffsets()
return self.db.profile.x, self.db.profile.y -- or whatever your DB is actually
end
You get the idea, I hope.