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

Fix clipping issued with ScrollArea #2860

Merged
merged 1 commit into from
Sep 4, 2023
Merged

Fix clipping issued with ScrollArea #2860

merged 1 commit into from
Sep 4, 2023

Conversation

Barugon
Copy link
Contributor

@Barugon Barugon commented Mar 31, 2023

Closes #2811.

This code causes incorrect clipping. It also uses incorrect indexing (1 - d instead of just d). With this code removed, I have not been able to find a case where the scroll area contents invade the scroll bar area.

Because this was asked about in the original PR (#2839), here is a simple project with embedded ScrollAreas. I cannot see any difference between this branch and master.
scroll_test.zip

@Barugon
Copy link
Contributor Author

Barugon commented Mar 31, 2023

Here's a screenshot of a ComboBox showing a date and time where I use UI::set_min_width in order to keep it from wrapping when the scroll bar appears.

Using the master branch:
Screenshot from 2023-03-31 12-19-10

Using this branch:
Screenshot from 2023-03-31 12-26-10

[edit] BTW, it would be nice to be able to disable wrapping for SelectableLabel, like how it can be disabled for Label.

@juancampa
Copy link
Contributor

juancampa commented Aug 19, 2023

This code also causes an issue when a ScrollArea::vertical() is rendered inside a menu.

The content is clipped horizontally to the hard-coded menu width when the scrollbar appears.

Removing the code seems to fix it as well.

Screen.Recording.2023-08-19.at.6.57.42.PM.mov

@Barugon
Copy link
Contributor Author

Barugon commented Aug 19, 2023

There are a number of issues that it causes but I haven't discovered what it's supposed to fix.

@emilk
Copy link
Owner

emilk commented Sep 4, 2023

The code was added here: https://github.com/emilk/egui/pull/2665/files

I wish I had added an example or test to justify it… I'm a bit scared of removing it now, but let's try it and see what pops up :)

@emilk emilk merged commit 72adf3b into emilk:master Sep 4, 2023
@Barugon Barugon deleted the scroll_area_clip branch September 4, 2023 18:33
@emilk emilk added bug Something is broken egui labels Sep 27, 2023
@emilk emilk changed the title Remove problematic clip code from ScrollArea Fix clipping issued with ScrollArea Sep 27, 2023
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.

ScrollArea ignores Spacing::scroll_bar_inner_margin for vertical scrollbar
3 participants