From 30fe9642442e4d424b2212f212965408ef85526c Mon Sep 17 00:00:00 2001 From: SoldierPePe Date: Sat, 31 Oct 2026 19:38:01 +0300 Subject: [PATCH] M10: a mirrored style picker sits beside the Design panel as drawn In a small or narrow window the Design panel is drawn narrower than its saved width, so the mirrored style picker read the saved width and could open over the panel. It now places itself from the panel's drawn rect, as the colour picker does; the left-to-right placement is unchanged. --- crates/ui-egui/src/widgets/style_picker.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/widgets/style_picker.rs b/crates/ui-egui/src/widgets/style_picker.rs index 8ba7c01d5..0cbb62359 100644 --- a/crates/ui-egui/src/widgets/style_picker.rs +++ b/crates/ui-egui/src/widgets/style_picker.rs @@ -1085,8 +1085,10 @@ pub fn show(app: &mut FigApp, ctx: &egui::Context) { // Beside the Design panel, on its canvas side; further out while the colour picker (which // sits there) is open. let gap = if app.ui.picker.is_some() { 32.0 + 260.0 } else { 32.0 }; + // Mirrored, the panel as drawn: a small window draws it narrower than asked, and a narrow one + // across the window, so the asked width would put the picker over it. let panel = if app.ui.mirrored { - egui::Rangef::new(screen.min.x, screen.min.x + app.ui.right_width) + app.ui.right_panel_rect.map_or_else(|| egui::Rangef::new(screen.min.x, screen.min.x + app.ui.right_width), |r| r.x_range()) } else { egui::Rangef::new(screen.max.x - app.ui.right_width, screen.max.x) };