Skip to content

Commit

Permalink
Calculate anchors since addons can be weird
Browse files Browse the repository at this point in the history
Fixes #129
  • Loading branch information
p3lim committed Dec 23, 2023
1 parent 6ebe819 commit 34250f6
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion addon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,13 @@ end)

-- re-anchor when shown
Molinari:HookScript('OnShow', function(self)
-- some addons put slots into a scrollframe for whatever reason, which we can't anchor to,
-- lets calculate anchors ourselves instead, adjusting for scale
local left, bottom, width, height = GameTooltip:GetOwner():GetScaledRect()
local scaleMultiplier = 1/UIParent:GetScale()
self:ClearAllPoints()
self:SetAllPoints(GetMouseFocus())
self:SetPoint('BOTTOMLEFT', left * scaleMultiplier, bottom * scaleMultiplier)
self:SetSize(width * scaleMultiplier, height * scaleMultiplier)
end)

-- set attribute to trigger EnterLeave driver
Expand Down

0 comments on commit 34250f6

Please sign in to comment.