fix(map): remove redundant scale-mismatched icon cull on world map

The manual overflow cull in HandleWorldMapPin compared icon:GetCenter()
against WorldMapScrollFrame's bounds without normalizing effective scale.
Magnify's zoom drags the icon's effective scale via WorldMapDetailFrame,
while the scroll frame's stays constant, so at high zoom ratios the
comparison failed for every icon and hid the whole map. Native
WorldMapScrollFrame:SetScrollChild() clipping (now reachable on all 4
edges since SetDrawOrder correctly detects bundled Magnify) already
handles this without the buggy manual math.
This commit is contained in:
2026-07-15 17:34:38 +02:00
parent 8089b5f08c
commit b4e0894c3f
+10 -20
View File
@@ -879,26 +879,16 @@ local function HandleWorldMapPin(icon, data)
icon:SetPoint("CENTER", WorldMapButton, "TOPLEFT", (x * worldmapWidth) / iconEffScale, -(y * worldmapHeight) / iconEffScale)
icon:Show()
-- Questie fix: when zoomed in (e.g. via Magnify/LootCollector), WorldMapButton is
-- drawn far larger than the visible window and only WorldMapScrollFrame clips it.
-- Pins positioned past the visible edge still render on top of the surrounding UI
-- instead of being clipped, so hide them manually once they're outside the
-- scroll frame's actual on-screen bounds. GetLeft/Right/Top/Bottom/Center are all
-- in a shared scale-independent coordinate space, so no extra scale math needed.
-- Only do this when the map is actually drawn larger than its viewport (the zoom
-- case) -- at normal size (e.g. just the "show objective" panel active, no zoom)
-- the whole map already fits on-screen, so this check should never fire there;
-- skip it entirely rather than risk false positives hiding valid icons.
if WorldMapScrollFrame and WorldMapScrollFrame:IsVisible() then
local scrollWidth, scrollHeight = WorldMapScrollFrame:GetWidth(), WorldMapScrollFrame:GetHeight()
if scrollWidth and scrollHeight and (worldmapWidth > scrollWidth + 1 or worldmapHeight > scrollHeight + 1) then
local iconCenterX, iconCenterY = icon:GetCenter()
local vLeft, vRight, vTop, vBottom = WorldMapScrollFrame:GetLeft(), WorldMapScrollFrame:GetRight(), WorldMapScrollFrame:GetTop(), WorldMapScrollFrame:GetBottom()
if iconCenterX and vLeft and (iconCenterX < vLeft or iconCenterX > vRight or iconCenterY > vTop or iconCenterY < vBottom) then
icon:Hide()
end
end
end
-- Manual GetLeft/Right/Top/Bottom-vs-GetCenter overflow culling used to live here
-- (Questie fix for Magnify/LootCollector zoom). Removed: it compared Get*() values
-- across frames with different effective scales (icon's scale is dragged around by
-- Magnify's WorldMapDetailFrame:SetScale() zoom, WorldMapScrollFrame's isn't), which
-- are only directly comparable at equal effective scale -- at high zoom ratios the
-- mismatch made the check fail for every icon, hiding the entire map. Icons are
-- already parented inside WorldMapButton, itself inside Magnify's real
-- WorldMapScrollFrame:SetScrollChild() subtree once SetDrawOrder correctly detects
-- Magnify (see Modules/Map/QuestieMapUtils.lua), so the engine's native scroll-child
-- clip now handles this on all 4 edges, during pan, with no Lua-side math needed.
else
icon:Hide()
end