Add files via upload

This commit is contained in:
Relationship
2026-07-16 17:56:42 +01:00
committed by GitHub
parent a276cca444
commit 8f4480bf14
4 changed files with 164 additions and 5 deletions
+13 -4
View File
@@ -52,15 +52,24 @@ end
MM._updatePosition = applyPosition
local function onDragUpdate()
local mx, my = GetCursorPosition()
local scale = UIParent:GetEffectiveScale() or 1
mx = mx / scale; my = my / scale
-- Do all math in the button's own effective scale. The button is
-- parented to Minimap, whose effective scale can differ from
-- UIParent's; mixing scales makes the icon drift away from the cursor.
local btn = this
local bscale = btn:GetEffectiveScale() or 1
local uscale = UIParent:GetEffectiveScale() or 1
local mx, my = GetCursorPosition()
mx = mx / bscale
my = my / bscale
local ucx, ucy = UIParent:GetCenter()
if not ucx then return end
-- Convert UIParent center from UIParent scale into btn scale.
ucx = ucx * uscale / bscale
ucy = ucy * uscale / bscale
local o = opts()
o.minimapX = mx - ucx
o.minimapY = my - ucy
applyPosition(this)
applyPosition(btn)
end
function MM:Create()