mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-24 04:50:49 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user