ui.at picks an origin plane where a click selects it (#575)

ui.at {plane} now returns the middle of the origin plane's square, or else the middle of a quarter that a click actually picks, so scripted clicks on XY no longer start a sketch on XZ from iso-like views.
This commit is contained in:
Kevin Ravensberg authored and GitHub committed 2026-10-13 02:42:45 -04:00
1 parent 736d9277b8
commit b1740aeee5
3 files changed
+37 -1

No files matched your search

+1 -1
View File
@@ -357,7 +357,7 @@ pub fn handle(app: &mut SolveApp, ctx: &egui::Context, req: &ControlRequest) ->
.and_then(|id| st.sketch(id))
.map(|ss| ss.plane.to_world(solidcraft_engine::geom::Vec2::new(num(s, 0), num(s, 1))))
} else if let Some(n) = p.get("plane").and_then(Value::as_str) {
crate::viewport::origin_planes(app).into_iter().find(|(name, _, _)| *name == n).map(|(_, _, q)| (q[0] + q[1] + q[2] + q[3]) / 4.0)
crate::viewport::origin_plane_target(app, &proj, n)
} else if let Some(n) = p.get("axis").and_then(Value::as_str) {
// Along an origin axis, on its solid part.
let size = crate::selection::origin_size(app.cam.half_height());