diff --git a/crates/ui-egui/src/canvas.rs b/crates/ui-egui/src/canvas.rs index a73a74f4..f04d2465 100644 --- a/crates/ui-egui/src/canvas.rs +++ b/crates/ui-egui/src/canvas.rs @@ -62,6 +62,16 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option)> { }; (ss.plane.to_world(mid), dir) } + // A corner picked into a sketch window (":", or a bare id when it + // was selected outside one): the value box sits on the corner itself. + Sel::SketchPoint { id } => { + let (sketch, point) = match id.split_once(':') { + Some((sketch, point)) => (sketch.parse().ok()?, point), + None => (app.session.active_sketch?, id.as_str()), + }; + let ss = st.sketch(sketch)?; + (ss.plane.to_world(ss.sketch.point(ss.sketch.resolve_point(point)?)?), None) + } Sel::Body { name } => (st.body(name)?.mesh().bounds().center(), None), Sel::Plane { name } => { let pl = solidcraft_engine::geom::Plane::named(name).or_else(|| { diff --git a/crates/ui-egui/src/dialogs.rs b/crates/ui-egui/src/dialogs.rs index b02435b7..21f61ab9 100644 --- a/crates/ui-egui/src/dialogs.rs +++ b/crates/ui-egui/src/dialogs.rs @@ -1191,6 +1191,39 @@ pub(crate) fn combo(ui: &mut egui::Ui, id: &str, labels: &[&str], sel: &mut usiz publish_row(&r.response); } +/// A mode choice as a row of icon buttons rather than a drop-down: every mode is on screen at +/// once, each drawn as the shape it makes, with its name as the tooltip. `labels` and `icons` +/// run in step; a mode with no icon gets the fallback square. Publishes the handles a combo +/// does, `dialog::