-
Notifications
You must be signed in to change notification settings - Fork 4
Update InputCapturingStateHover calculation to support collapsed panels #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
hajimehoshi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
- Make code "Hajime-spec" :-)
- Make code "Hajime-spec" :-)
context.go
Outdated
| for _, cnt := range c.rootContainers { | ||
| bounds := cnt.layout.Bounds | ||
| if cnt.collapsed { | ||
| bounds.Max.Y -= cnt.layout.BodyBounds.Dy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bounds.Max.Y = cnt.layout.BodyBounds.Min.YThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 1733713
hajimehoshi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Resolves #34 by updating InputCapturingStateHover calculation to support collapsed panels.
This PR fixes an issue where
InputCapturingStateHovercould still be returned for a collapsed window.Problem
When a debug UI window is collapsed, the full
layout.Boundswas still being checked for pointer containment. This meant that even when only the title bar was visible,InputCapturingStateHoverwould be set if the pointer was anywhere in the (now-hidden) body area.Fix
collapsedBoundsrectangle that excludes the body area by subtractingBodyBounds.Dy()from the bottom of the window.collapsedBoundsto determine whether the pointer is hovering over a collapsed window’s visible area (i.e. just the title bar).InputCapturingStateHoverreflects only what is actually visible.