fix(map): pixel-snap minimap icons to align with native blips at fractional scales (#6)

At fractional UI scales (e.g. 0.71 game scale + Windows display scaling)
the raw fractional pin offset landed icons between physical pixels,
rendering blurry and offset from the engine-drawn native quest blips.
Snap the offset to a whole physical pixel via the minimap's effective
scale so Questie's icons sit on the same grid as native markers.
This commit is contained in:
Xurkon
2026-06-10 20:34:20 -05:00
parent 6ad4308940
commit cee005fc63
2 changed files with 14 additions and 1 deletions
+13 -1
View File
@@ -490,7 +490,19 @@ local function drawMinimapPin(pin, data)
if dist <= 1 or (data.floatOnEdge and ((pin.texture and pin.texture.a and pin.texture.a ~= 0) or pin.texture == nil)) then
pin:Show()
pin:ClearAllPoints()
pin:SetPoint("CENTER", pins.Minimap, "CENTER", diffX * minimapWidth, -diffY * minimapHeight)
-- Snap the icon offset to the physical pixel grid. At fractional UI scales (e.g. a
-- 0.71 game scale combined with Windows display scaling) a raw fractional offset lands
-- the icon between physical pixels, so it renders blurry and visibly misaligned with the
-- engine-drawn native quest blips that ARE pixel-aligned (#6). Rounding the offset to a
-- whole physical pixel keeps Questie's pins on the same grid as the native markers.
local ox = diffX * minimapWidth
local oy = -diffY * minimapHeight
local eScale = pins.Minimap:GetEffectiveScale()
if eScale and eScale > 0 then
ox = math.floor(ox * eScale + 0.5) / eScale
oy = math.floor(oy * eScale + 0.5) / eScale
end
pin:SetPoint("CENTER", pins.Minimap, "CENTER", ox, oy)
data.onEdge = (dist > 1)
else
pin:Hide()