Put Move/Copy Sketch Entities on the toolbar, behind a window with distances, an angle and a copy flag (#735)
Sketch Move gets a toolbar placement in Sketch > Modify and a Move/Copy tool window with X and Y distances, an angle, an optional centre point and a Create Copy flag, replacing the context-menu route that ran the command with no parameters.
This commit is contained in:
1 parent
de1479029d
commit
facff1050e
10 files changed
+319
-8
No files matched your search
@@ -85,7 +85,14 @@ pub fn anchor(app: &SolveApp, d: &Dialog) -> Option<(Vec3, Option<Vec3>)> {
|
||||
Kind::Sheet(_) => (at, crate::dialogs_sheet::arrow(app, d).or(normal)),
|
||||
Kind::Plastic(_) => (at, normal),
|
||||
Kind::PatternRect { .. } => (at, d.inputs.get(1).and_then(|i| i.items.first()).and_then(|x| crate::dialogs::axis_of(app, x)).map(|a| a.1)),
|
||||
// Already computed above, per picked curve; keep it rather than the default below.
|
||||
// A sketch move's X Distance grows along the sketch's own x axis, so its drag arrow
|
||||
// lies in the sketch plane. Scale has no arrow: a factor is not a length, and the
|
||||
// square handle it wants is its own change.
|
||||
Kind::SketchModify(crate::sketch_modify_ui::Mod::Move { .. }) => {
|
||||
(at, app.session.active_sketch.and_then(|id| st.sketch(id)).and_then(|ss| ss.plane.x.normalized()))
|
||||
}
|
||||
// Offset's arrow is already computed above, per picked curve; keep it rather than the
|
||||
// default below.
|
||||
Kind::SketchModify(_) => (at, normal),
|
||||
_ => (at, None),
|
||||
})
|
||||
@@ -282,8 +289,15 @@ fn draw(app: &SolveApp, ui: &mut egui::Ui, painter: &egui::Painter, proj: &Proj,
|
||||
};
|
||||
let symmetric = to_span.is_none() && matches!(d.kind, Kind::Extrude { direction: 2, .. });
|
||||
// Extrudes and moves go either way; radii and thicknesses stay positive.
|
||||
let signed =
|
||||
matches!(d.kind, Kind::Extrude { .. } | Kind::Move { .. } | Kind::Section { .. } | Kind::OffsetPlane { .. } | Kind::OffsetFaces { .. });
|
||||
let signed = matches!(
|
||||
d.kind,
|
||||
Kind::Extrude { .. }
|
||||
| Kind::Move { .. }
|
||||
| Kind::Section { .. }
|
||||
| Kind::OffsetPlane { .. }
|
||||
| Kind::OffsetFaces { .. }
|
||||
| Kind::SketchModify(crate::sketch_modify_ui::Mod::Move { .. })
|
||||
);
|
||||
let focus = std::mem::take(&mut d.focus);
|
||||
let half_height = app.cam.half_height();
|
||||
let axis = revolve_axis(app, d);
|
||||
|
||||
Reference in new issue
Block a user