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
+1 -1
View File
@@ -317,7 +317,7 @@ pfUI:RegisterModule("actionbar", function ()
-- handle button highlight
if keystate == "down" then
self.highlight:Show()
elseif not MouseIsOver(self) then
elseif not MouseIsOverHitRect(self) then
self.highlight:Hide()
end
end
+5 -5
View File
@@ -176,8 +176,8 @@ pfUI:RegisterModule("equipmentmanager", function()
rowMenu:RegisterEvent("GLOBAL_MOUSE_DOWN")
rowMenu:SetScript("OnEvent", function()
if not this:IsShown() then return end
if MouseIsOver(this) then return end
if this.anchorBtn and MouseIsOver(this.anchorBtn) then return end
if MouseIsOverHitRect(this) then return end
if this.anchorBtn and MouseIsOverHitRect(this.anchorBtn) then return end
this:Hide()
end)
tinsert(UISpecialFrames, "pfEqMgrRowMenu") -- Escape closes it
@@ -313,10 +313,10 @@ pfUI:RegisterModule("equipmentmanager", function()
-- Show the gear and tooltip while the cursor is over the row or its
-- gear child. The gear sits inside the row's rectangle, so a single
-- MouseIsOver(row) check covers both. OnLeave on the row and the gear
-- catches every exit path, so no OnUpdate poll is needed.
-- MouseIsOverHitRect(row) check covers both. OnLeave on the row and the
-- gear catches every exit path, so no OnUpdate poll is needed.
local function HideRowHover()
if MouseIsOver(row) then return end
if MouseIsOverHitRect(row) then return end
GameTooltip:Hide()
row.gear:Hide()
end
+3 -2
View File
@@ -58,10 +58,11 @@ pfUI:RegisterModule("gui", function ()
return
end
if MouseIsOver(this) and not this.over then
local over = MouseIsOverHitRect(this)
if over and not this.over then
this.tex:Show()
this.over = true
elseif not MouseIsOver(this) and this.over then
elseif not over and this.over then
this.tex:Hide()
this.over = nil
end
+1 -1
View File
@@ -191,7 +191,7 @@ end
local self = self or this
if self.text_mouse == "1" then
self.bar.text:SetShown(MouseIsOver(self))
self.bar.text:SetShown(self.hover)
end
if self.always then return end