mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-23 20:40:50 +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:
+12
@@ -1543,6 +1543,18 @@ function pfUI.api.BarButtonAnchor(button,basename,buttonindex,barsize,formfactor
|
||||
return button._anchor
|
||||
end
|
||||
|
||||
-- [ MouseIsOverHitRect ] --
|
||||
-- Like MouseIsOver, but tests the frame's hit rect, the area the engine
|
||||
-- uses for mouse focus and OnEnter/OnLeave. CreateBackdrop widens that
|
||||
-- rect by the border, so plain MouseIsOver misses a band around the frame.
|
||||
-- 'frame' the frame to test
|
||||
-- return true when the cursor is inside the frame's hit rect
|
||||
function pfUI.api.MouseIsOverHitRect(frame)
|
||||
if not frame.GetHitRectInsets then return MouseIsOver(frame) end
|
||||
local left, right, top, bottom = frame:GetHitRectInsets()
|
||||
return MouseIsOver(frame, -top, bottom, left, -right)
|
||||
end
|
||||
|
||||
-- [ Enable Autohide ] --
|
||||
-- 'frame' the frame that should be hidden
|
||||
function pfUI.api.EnableAutohide(frame, timeout, combat)
|
||||
|
||||
Reference in New Issue
Block a user