Test hover against the hit rect, not the bare frame rect

CreateBackdrop widens a frame's hit rect by the border, so mouse focus
and OnEnter/OnLeave cover a band that plain MouseIsOver reports as
outside. Add MouseIsOverHitRect, which passes the frame's hit rect
insets as MouseIsOver offsets, and use it at the unpadded call sites.
The XP bar's hover text follows the same OnEnter/OnLeave flag as its
fade.
This commit is contained in:
Brues
2026-10-22 21:36:27 -05:00
parent 9cb21b982b
commit b9f473c049
6 changed files with 24 additions and 11 deletions
+2 -2
View File
@@ -661,7 +661,7 @@ function pfUI.api.SkinButton(button, cr, cg, cb, icon, disableHighlight)
end
b.UnlockHighlight = function()
if not MouseIsOver(b) then
if not MouseIsOverHitRect(b) then
b:SetBackdropBorderColor(GetStringColor(pfUI_config.appearance.border.color))
end
b.locked = false
@@ -1175,7 +1175,7 @@ function pfUI.api.CreateInfoBox(text, time, parent, height)
if GetTime() > infobox.lastshow + infobox.duration then
if not infobox.fade:IsPlaying() then infobox.fade:Play() end
elseif MouseIsOver(this) then
elseif MouseIsOverHitRect(this) then
this:SetAlpha(max(0.4, this:GetAlpha() - .1))
else
this:SetAlpha(min(1, this:GetAlpha() + .1))