From 5d3e958ecfd3468a460c57094ebaeca6e3c4f325 Mon Sep 17 00:00:00 2001 From: limo520 Date: Thu, 27 Aug 2026 09:14:01 +0800 Subject: [PATCH] Fix the constrain option not working in the window options demo (#8433) `constrain_to` overrides `constrain`, so I adjusted it to call `constrain_to` before `constrain`. * [x] I have followed the instructions in the PR template Signed-off-by: limo520 <247564335@qq.com> --- crates/egui_demo_lib/src/demo/window_options.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/egui_demo_lib/src/demo/window_options.rs b/crates/egui_demo_lib/src/demo/window_options.rs index d95faa546..6a45778e9 100644 --- a/crates/egui_demo_lib/src/demo/window_options.rs +++ b/crates/egui_demo_lib/src/demo/window_options.rs @@ -71,13 +71,13 @@ impl crate::Demo for WindowOptions { let mut window = egui::Window::new(title) .id(egui::Id::new("demo_window_options")) // required since we change the title .resizable(resizable) + .constrain_to(ui.available_rect_before_wrap()) .constrain(constrain) .collapsible(collapsible) .movable(movable) .title_bar(title_bar) .drag_area(drag_area) .scroll(scroll2) - .constrain_to(ui.available_rect_before_wrap()) .enabled(enabled); if closable { window = window.open(open);