Dragonflight: All The Things map icon is inside map
Xaymar opened this issue ยท 2 comments
Using master
branch (43be687), the map icon for All The Things is inside of the map:
Fairly sure it should be outside of the map.
Did some code review against LibDBIcon-1.0
and changed "Button Configuration" section to this instead.
-- Button Configuration
local radius = 5;
local rounding = 10;
local MinimapShapes = {
-- quadrant booleans (same order as SetTexCoord)
-- {bottom-right, bottom-left, top-right, top-left}
-- true = rounded, false = squared
["ROUND"] = {true, true, true, true },
["SQUARE"] = {false, false, false, false},
["CORNER-TOPLEFT"] = {false, false, false, true },
["CORNER-TOPRIGHT"] = {false, false, true, false},
["CORNER-BOTTOMLEFT"] = {false, true, false, false},
["CORNER-BOTTOMRIGHT"] = {true, false, false, false},
["SIDE-LEFT"] = {false, true, false, true },
["SIDE-RIGHT"] = {true, false, true, false},
["SIDE-TOP"] = {false, false, true, true },
["SIDE-BOTTOM"] = {true, true, false, false},
["TRICORNER-TOPLEFT"] = {false, true, true, true },
["TRICORNER-TOPRIGHT"] = {true, false, true, true },
["TRICORNER-BOTTOMLEFT"] = {true, true, false, true },
["TRICORNER-BOTTOMRIGHT"] = {true, true, true, false},
};
button.update = function(self)
local position = GetDataMember("Position", -10.31);
local angle = math.rad(position) -- determine position on your own
local x, y
local cos = math.cos(angle)
local sin = math.sin(angle)
local q = 1;
local w = (Minimap:GetWidth() / 2) + radius
local h = (Minimap:GetHeight() / 2) + radius
if cos < 0 then
q = q + 1; -- lower
end
if sin > 0 then
q = q + 2; -- right
end
if MinimapShapes[GetMinimapShape and GetMinimapShape() or "ROUND"][q] then
x = cos*w;
y = sin*h;
else
local diagRadiusW = sqrt(2*(w)^2)-10
local diagRadiusH = sqrt(2*(h)^2)-10
x = math.max(-w, math.min(cos*diagRadiusW, w))
y = math.max(-h, math.min(sin*diagRadiusH, h))
end
self:SetPoint("CENTER", "Minimap", "CENTER", -x, y);
end
local update = function(self)
local w, x = GetCursorPosition();
local y, z = Minimap:GetLeft(), Minimap:GetBottom();
local s = UIParent:GetScale();
w = y - w / s + 70; x = x / s - z - 70;
SetDataMember("Position", math.deg(math.atan2(x, w)));
self:Raise();
self:update();
end
This should be somewhat rectified since b8540d9. It will be included in the next release.