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.
This commit is contained in:
SoldierPePe
2026-11-05 02:59:04 +03:00
parent 5233c451de
commit 30fe964244
+3 -1
View File
@@ -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)
};