diff --git a/crates/egui/src/containers/area.rs b/crates/egui/src/containers/area.rs index 380c175b3..953391cad 100644 --- a/crates/egui/src/containers/area.rs +++ b/crates/egui/src/containers/area.rs @@ -426,7 +426,7 @@ impl Prepared { temporarily_invisible: _, } = self; - state.size = content_ui.min_rect().size(); + state.size = content_ui.min_size(); ctx.memory_mut(|m| m.areas.set_state(layer_id, state)); diff --git a/crates/egui_demo_lib/src/demo/strip_demo.rs b/crates/egui_demo_lib/src/demo/strip_demo.rs index 2e9038b3a..db42fcb0b 100644 --- a/crates/egui_demo_lib/src/demo/strip_demo.rs +++ b/crates/egui_demo_lib/src/demo/strip_demo.rs @@ -37,7 +37,7 @@ impl super::View for StripDemo { .size(Size::exact(50.0)) .size(Size::remainder()) .size(Size::relative(0.5).at_least(60.0)) - .size(Size::exact(10.0)) + .size(Size::exact(10.5)) .vertical(|mut strip| { strip.cell(|ui| { ui.painter().rect_filled( diff --git a/crates/egui_demo_lib/src/demo/table_demo.rs b/crates/egui_demo_lib/src/demo/table_demo.rs index 8fdea4202..6523805ba 100644 --- a/crates/egui_demo_lib/src/demo/table_demo.rs +++ b/crates/egui_demo_lib/src/demo/table_demo.rs @@ -38,7 +38,6 @@ impl super::Demo for TableDemo { fn show(&mut self, ctx: &egui::Context, open: &mut bool) { egui::Window::new(self.name()) .open(open) - .resizable(true) .default_width(400.0) .show(ctx, |ui| { use super::View as _; @@ -102,7 +101,7 @@ impl super::View for TableDemo { use egui_extras::{Size, StripBuilder}; StripBuilder::new(ui) .size(Size::remainder().at_least(100.0)) // for the table - .size(Size::exact(10.0)) // for the source code link + .size(Size::exact(10.5)) // for the source code link .vertical(|mut strip| { strip.cell(|ui| { egui::ScrollArea::horizontal().show(ui, |ui| { diff --git a/crates/emath/src/rect.rs b/crates/emath/src/rect.rs index b8c6085a2..de115b985 100644 --- a/crates/emath/src/rect.rs +++ b/crates/emath/src/rect.rs @@ -280,6 +280,7 @@ impl Rect { } } + /// `rect.size() == Vec2 { x: rect.width(), y: rect.height() }` #[inline(always)] pub fn size(&self) -> Vec2 { self.max - self.min