From 87b5dcdf5e0a34892e6f6a99d3b053fe5b1791cb Mon Sep 17 00:00:00 2001 From: rustbasic <127506429+rustbasic@users.noreply.github.com> Date: Mon, 28 Oct 2024 19:29:51 +0900 Subject: [PATCH] Update window.rs --- crates/egui/src/containers/window.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index 438d562ede7..3ce4339edf4 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -287,7 +287,9 @@ impl<'open> Window<'open> { /// Set initial size of the window. #[inline] pub fn default_size(mut self, default_size: impl Into) -> Self { + let default_size: Vec2 = default_size.into(); self.resize = self.resize.default_size(default_size); + self.area = self.area.default_size(default_size); self } @@ -295,6 +297,7 @@ impl<'open> Window<'open> { #[inline] pub fn default_width(mut self, default_width: f32) -> Self { self.resize = self.resize.default_width(default_width); + self.area = self.area.default_width(default_width); self } @@ -302,6 +305,7 @@ impl<'open> Window<'open> { #[inline] pub fn default_height(mut self, default_height: f32) -> Self { self.resize = self.resize.default_height(default_height); + self.area = self.area.default_height(default_height); self }