map: recalculate world frame position on scale

This commit is contained in:
shagu
2025-06-14 19:23:29 +02:00
parent 124dcf2e8f
commit c772825814
+11 -1
View File
@@ -63,7 +63,17 @@ pfUI:RegisterModule("map", "vanilla:tbc", function ()
end
if IsControlKeyDown() then
scale = clamp(WorldMapFrame:GetScale() + arg1/10, 0.1, 2.0)
local oldscale = WorldMapFrame:GetScale()
local point, rel, relpoint, offx, offy = WorldMapFrame:GetPoint()
scale = clamp(oldscale + arg1/10, 0.1, 2.0)
-- recalculate world frame position based on old and new scale
if point == "TOPLEFT" and relpoint == "TOPLEFT" then
offx = offx*oldscale/scale
offy = offy*oldscale/scale
WorldMapFrame:SetPoint(point, rel, relpoint, offx, offy)
end
WorldMapFrame:SetScale(scale)
UpdateTooltipScale()
end