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

ScrollArea: Prevent drag interaction outside the area #4611

Merged
merged 2 commits into from
Jun 6, 2024

Conversation

s-nie
Copy link
Contributor

@s-nie s-nie commented Jun 5, 2024

@s-nie s-nie changed the title Scroll Area: Prevent drag interaction outside the area ScrollArea: Prevent drag interaction outside the area Jun 5, 2024
@emilk emilk added bug Something is broken egui labels Jun 5, 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.

I tested it, and it creates a bunch of bugs.

Try clicking around on the right side panel in the egui demo app, for instance.

I think the problem is that the late interact call means the interaction is on top of the contents, while it should be below. So my idea wasn't great.

Better to store the final size for the next frame afterall

@s-nie
Copy link
Contributor Author

s-nie commented Jun 5, 2024

I think the problem is that the late interact call means the interaction is on top of the contents, while it should be below.

Right, I had not considered this. I changed the approach in 4e1ea29, now the demo app works fine for me.

@s-nie s-nie requested a review from emilk June 6, 2024 07:48
@emilk emilk merged commit 1f008fb into emilk:master Jun 6, 2024
19 checks passed
@emilk
Copy link
Owner

emilk commented Jun 6, 2024

Thanks!

@s-nie s-nie deleted the 4349-scroll-area-drag-fix branch June 6, 2024 13:37
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.

Window contents can sometimes be affected by mouse interaction outside the window
2 participants