From 3e993df4d1a5f5eb07e73bfcfca234f1ad119062 Mon Sep 17 00:00:00 2001 From: Brandon Thomas Date: Fri, 9 Oct 2026 13:52:50 -0400 Subject: [PATCH] Fix sizing labels and clippy type complexity Co-Authored-By: Claude Opus 5.5 --- crates/ui-egui/src/handles.rs | 5 ++++- crates/ui-egui/src/right.rs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui-egui/src/handles.rs b/crates/ui-egui/src/handles.rs index 43fbc06..ef8c4ec 100644 --- a/crates/ui-egui/src/handles.rs +++ b/crates/ui-egui/src/handles.rs @@ -72,7 +72,10 @@ fn screen_to_unit(app: &FigApp, id: NodeId, s: Pos2) -> Option<(f64, f64)> { } /// Auto layout zones of a single selected AL frame, in screen space: padding bands and gaps. -fn al_zones(app: &FigApp) -> Option<(NodeId, Vec<(usize, Rect, f64)>, Vec, f64, bool)> { +/// (frame, padding bands (side, rect, value), gap rects, gap, vertical) +type Zones = (NodeId, Vec<(usize, Rect, f64)>, Vec, f64, bool); + +fn al_zones(app: &FigApp) -> Option { let ds = app.session.ds().ok()?; if ds.selection.len() != 1 || ds.text_edit.is_some() || ds.vector_edit.is_some() { return None; diff --git a/crates/ui-egui/src/right.rs b/crates/ui-egui/src/right.rs index 9f2d7bb..365812c 100644 --- a/crates/ui-egui/src/right.rs +++ b/crates/ui-egui/src/right.rs @@ -511,7 +511,7 @@ fn layout(app: &mut FigApp, ui: &mut Ui, doc: &Document, sel: &[NodeId]) { let label = cur.map(|s| s.label()).unwrap_or("Mixed"); let resp = widgets::dropdown( ui, - &format!("{label} {}", if axis == "W" { "width" } else { "height" }), + label, half, Some(match cur { Some(Sizing::Hug) => Icon::Hug,