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's scrollbar goes past frame's borders #3734

Open
tamewild opened this issue Dec 24, 2023 · 1 comment · May be fixed by #5286
Open

ScrollArea's scrollbar goes past frame's borders #3734

tamewild opened this issue Dec 24, 2023 · 1 comment · May be fixed by #5286
Labels
bug Something is broken egui

Comments

@tamewild
Copy link

tamewild commented Dec 24, 2023

Describe the bug
When using show_rows with a high amounts of rows, the scrollbar can go past the frame's borders. The part of the scrollbar outside of the frame's borders can't be interacted with. Problem is exacerbated with even more rows + higher row height.

When the window is taller, the problem seems to lessen but it doesn't help that much if you have a high enough row count.

Image of the overflowed scrollbar at the top of the frame:
image

Image of the overflowed scrollbar at the bottom of the frame:
image

To Reproduce
Using this code on the latest master:

use eframe::egui::{CentralPanel, ScrollArea};
use eframe::{egui, NativeOptions};
use eframe::egui::scroll_area::ScrollBarVisibility;
use eframe::egui::style::ScrollStyle;

fn main() {
    eframe::run_simple_native("", NativeOptions::default(), |ctx, frame| {
        ctx.style_mut(|x| x.spacing.scroll = ScrollStyle::solid());
        CentralPanel::default().show(ctx, |ui| {
            egui::Frame::canvas(ui.style())
                .show(ui, |ui| {
                    ScrollArea::vertical()
                        .scroll_bar_visibility(ScrollBarVisibility::AlwaysVisible)
                        .auto_shrink([false, false])
                        .show_rows(ui, 1000.0, 10000, |_, _| {});
                });
        });
    }).unwrap();
}

Expected behavior
The scrollbar should remain in the frame without causing visual incongruencies

Additional context
This was tested on the latest master

@gilbertoalexsantos
Copy link

This issue can also be reproduced in the egui demo.

I created a PR to address it: #5286

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 a pull request may close this issue.

3 participants