Give dragged widgets real mouse capture #37

Merged
embeddedt merged 1 commits from rdh/celeritas:gui-dragging-better into stonecutter 2026-08-31 14:31:01 -04:00
Collaborator

Sliders and the scrollbar thumb only kept updating while the cursor stayed within their own (often very narrow) hitbox, so a drag would stop tracking the mouse when the cursor drifted a few
pixels off. This is most noticeable on sliders, whose track is only ~10px tall.

Fixed by tracking which child claimed a mouseClicked and route drag/release straight to it regardless of cursor position until release, and stop rendering sibling widgets as hovered (or showing their tooltip) while a capture is active elsewhere.

Sliders and the scrollbar thumb only kept updating while the cursor stayed within their own (often very narrow) hitbox, so a drag would stop tracking the mouse when the cursor drifted a few pixels off. This is most noticeable on sliders, whose track is only ~10px tall. Fixed by tracking which child claimed a mouseClicked and route drag/release straight to it regardless of cursor position until release, and stop rendering sibling widgets as hovered (or showing their tooltip) while a capture is active elsewhere.
rdh added 1 commit 2026-08-31 13:29:18 -04:00
embeddedt approved these changes 2026-08-31 13:30:31 -04:00
embeddedt merged commit 5e6c6e2b06 into stonecutter 2026-08-31 14:31:01 -04:00
embeddedt deleted branch gui-dragging-better 2026-08-31 14:31:01 -04:00
Sign in to join this conversation.
No Reviewers
No labels
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: embeddedt/celeritas#37