Skip to content

Commit feb817b

Browse files
committed
fix: rollback the wa icon crop logic
1 parent c6a8809 commit feb817b

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Modules/Skins/Addons/WeakAuras.lua

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,12 +53,22 @@ local function HandleComplexTexCoords(icon)
5353
cLeft, cRight, cTop, cDown = ULx, ULy, LLx, LLy
5454
end
5555

56+
local left, right, top, down = unpack(E.TexCoords)
5657
if cLeft == 0 or cRight == 0 or cTop == 0 or cDown == 0 then
5758
local width, height = cRight - cLeft, cDown - cTop
5859
if width == height then
59-
F.CallMethod(self, "SetTexCoord", unpack(E.TexCoords))
60+
F.CallMethod(self, "SetTexCoord", left, right, top, down)
61+
elseif width > height then
62+
F.CallMethod(
63+
self,
64+
"SetTexCoord",
65+
left,
66+
right,
67+
top + cTop * (right - left),
68+
top + cDown * (right - left)
69+
)
6070
else
61-
F.CallMethod(self, "SetTexCoord", E:CropRatio(width, height))
71+
F.CallMethod(self, "SetTexCoord", left + cLeft * (down - top), left + cRight * (down - top), top, down)
6272
end
6373
else
6474
F.CallMethod(self, "SetTexCoord", cLeft, cRight, cTop, cDown)

0 commit comments

Comments
 (0)