Skip to content
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

Avoid interacting twice when not required #4041

Merged
merged 1 commit into from Feb 14, 2024
Merged

Conversation

abey79
Copy link
Collaborator

@abey79 abey79 commented Feb 14, 2024

This PR short-circuits Response::interact() when the Response has already been sufficiently "sensed" already. In some circumstance, this can avoid unnecessarily registering another widget rect that may mask some other widget.

One such instance is Rerun's ListItem. Calling context_menu() on its response would call interact and, in turn, mask its sub-widget (collapsing triangle, show/hide buttons, etc.).

@abey79 abey79 added egui bug Something is broken labels Feb 14, 2024
Copy link
Owner

@emilk emilk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@emilk emilk merged commit 0e1bcc2 into master Feb 14, 2024
37 checks passed
@emilk emilk deleted the antoine/no-double-interact branch February 14, 2024 08:07
emilk pushed a commit that referenced this pull request Feb 14, 2024
This PR short-circuits `Response::interact()` when the `Response` has
already been sufficiently "sensed" already. In some circumstance, this
can avoid unnecessarily registering another widget rect that may mask
some other widget.

One such instance is Rerun's `ListItem`. Calling `context_menu()` on its
response would call `interact` and, in turn, mask its sub-widget
(collapsing triangle, show/hide buttons, etc.).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken egui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants