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

Improve Response.dragged, drag_started and clicked #3888

Merged
merged 4 commits into from
Jan 25, 2024

Conversation

emilk
Copy link
Owner

@emilk emilk commented Jan 25, 2024

If a widgets sense both clicks and drags, we don't know wether or not a mouse press on it will be a short click or a long drag.

With this PR, response.dragged and response.drag_started isn't true until we know it is a drag and not a click.
If the widget ONLY senses drags, then we know as soon as someone presses on it that it is a drag.
If it is sensitive to both clicks and drags, we don't know until the mouse moves a bit, or stays pressed down long enough.

This PR also ensures that response.clicked and is only true for widgets that senses clicks.

@emilk emilk added the egui label Jan 25, 2024
@emilk emilk merged commit a815923 into master Jan 25, 2024
36 checks passed
@emilk emilk deleted the emilk/redefine-dragged branch January 25, 2024 16:28
AmesingFlank added a commit to AmesingFlank/LightSalon that referenced this pull request Feb 16, 2024
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.

1 participant