Skip to content

Conversation

@emilk
Copy link
Owner

@emilk emilk commented Dec 12, 2024

When there are multiple layers (e.g. with custom transforms) close to each other, the hit test code used to only consider widgets in the layer directly under the mouse. This can make it difficult to hit thin widgets just on the outside of a transform layer.

This PR fixes that.

It also prioritizes thin widgets, so that if there is both a thin widget and a thick widget under the mouse cursor, you will always hit the thin widgets, even if the thin widgets is layered behind the thick one. This makes it easier to hit thin resize-handles.

In theory this should allow us to make resize_grab_radius_side and resize_grab_radius_corner smaller in a future PR, if we want to.

@emilk emilk added the egui label Dec 12, 2024
@github-actions
Copy link

Preview available at https://egui-pr-preview.github.io/pr/5468-emilkimprove-cross-layer-hit-test
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@emilk emilk changed the title Improve cross-layer hit test Improve hit-test of thin widgets, and widgets across layers Dec 13, 2024
@emilk emilk marked this pull request as ready for review December 13, 2024 07:13
@emilk emilk marked this pull request as draft December 13, 2024 07:20
@emilk emilk marked this pull request as ready for review December 13, 2024 08:17
@emilk emilk merged commit f7efb21 into master Dec 16, 2024
46 checks passed
@emilk emilk deleted the emilk/improve-cross-layer-hit-test branch December 16, 2024 08:33
emilk added a commit that referenced this pull request Dec 22, 2025
* Added in #5468
* Related to #7803

The code doesn't seem to longer be needed. Interacting with a resize
splitter isn't very difficult, and I never liked that special case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants