From 6447be7f79b8e6d141948af23eaeee5acd150d41 Mon Sep 17 00:00:00 2001 From: Emil Ernerfeldt Date: Wed, 5 Jun 2024 12:08:38 +0200 Subject: [PATCH] Set the `sizing_pass` flag in first frame of `egui_extras::Table` --- crates/egui_extras/src/table.rs | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/crates/egui_extras/src/table.rs b/crates/egui_extras/src/table.rs index cfcc0c9dd2a..c6b203aab36 100644 --- a/crates/egui_extras/src/table.rs +++ b/crates/egui_extras/src/table.rs @@ -437,8 +437,11 @@ impl<'a> TableBuilder<'a> { let table_top = ui.cursor().top(); - // Hide first-frame-jitters when auto-sizing. - ui.add_visible_ui(!first_frame_auto_size_columns, |ui| { + ui.scope(|ui| { + if first_frame_auto_size_columns { + // Hide first-frame-jitters when auto-sizing. + ui.set_sizing_pass(); + } let mut layout = StripLayout::new(ui, CellDirection::Horizontal, cell_layout, sense); let mut response: Option = None; add_header_row(TableRow { @@ -648,7 +651,11 @@ impl<'a> Table<'a> { let clip_rect = ui.clip_rect(); // Hide first-frame-jitters when auto-sizing. - ui.add_visible_ui(!first_frame_auto_size_columns, |ui| { + ui.scope(|ui| { + if first_frame_auto_size_columns { + ui.set_sizing_pass(); + } + let hovered_row_index_id = self.state_id.with("__table_hovered_row"); let hovered_row_index = ui.data_mut(|data| data.remove_temp::(hovered_row_index_id));