1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 22:00:03 -04:00

egui_extras::Table: fix bugs in the virtual scrolling

This commit is contained in:
Emil Ernerfeldt
2022-04-11 17:54:57 +02:00
parent 56b127f209
commit 701ae3cb46
3 changed files with 65 additions and 72 deletions

View File

@@ -458,9 +458,7 @@ impl ScrollArea {
self.show_viewport(ui, |ui, viewport| {
ui.set_height((row_height_with_spacing * total_rows as f32 - spacing.y).at_least(0.0));
let min_row = (viewport.min.y / row_height_with_spacing)
.floor()
.at_least(0.0) as usize;
let min_row = (viewport.min.y / row_height_with_spacing).floor() as usize;
let max_row = (viewport.max.y / row_height_with_spacing).ceil() as usize + 1;
let max_row = max_row.at_most(total_rows);