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 ignores Spacing::scroll_bar_inner_margin for vertical scrollbar #2811

Closed
Barugon opened this issue Mar 13, 2023 · 1 comment · Fixed by #2860
Closed

ScrollArea ignores Spacing::scroll_bar_inner_margin for vertical scrollbar #2811

Barugon opened this issue Mar 13, 2023 · 1 comment · Fixed by #2860
Labels
bug Something is broken

Comments

@Barugon
Copy link
Contributor

Barugon commented Mar 13, 2023

Describe the bug
I show a ScrollArea after setting Spacing::scroll_bar_inner_margin to 0.0 and here's the result that I get:

Screenshot from 2023-03-13 13-10-49

Note that the horizontal scrollbar is correct while the vertical scrollbar still has the default margin.

This behavior started with v0.21.

@Barugon Barugon added the bug Something is broken label Mar 13, 2023
@Barugon
Copy link
Contributor Author

Barugon commented Mar 13, 2023

#2665 seems to be the culprit, specifically this (scroll_area.rs:442):

                    if state.show_scroll[d] {
                        // Make sure content doesn't cover scroll bars
                        let tiny_gap = 1.0;
                        content_clip_rect.max[1 - d] =
                            inner_rect.max[1 - d] + scroll_bar_inner_margin - tiny_gap;
                    }

If I disable that bit of code then it works correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant