path.moveAnchors: take the Drag Path step name

The Convert Point tool names a whole-path drag as the reference does (#12741). Any other stepName is refused, as with path.convertPoint and path.moveHandle.
This commit is contained in:
rmsff committed 2026-11-11 22:02:49 +03:00
1 parent 78e478adda
commit 28fd0f4c1e
1 file changed
+4 -3
+4 -3
View File
@@ -116,10 +116,11 @@ fn move_anchors(s: &mut Session, p: &Value) -> Result<Value> {
})
.collect::<Result<_>>()?;
let d = offset(CMD, p)?;
let label = step_name(CMD, p, "Drag Anchor Points", "Drag Path")?;
if p.get("curvature").and_then(Value::as_bool).unwrap_or(false) {
return edit_path(s, CMD, p, "Drag Anchor Points", |path| edit::move_anchors_curvature(path, &anchors, d));
return edit_path(s, CMD, p, label, |path| edit::move_anchors_curvature(path, &anchors, d));
}
edit_path(s, CMD, p, "Drag Anchor Points", |path| edit::move_anchors(path, &anchors, d))
edit_path(s, CMD, p, label, |path| edit::move_anchors(path, &anchors, d))
}
fn move_handle(s: &mut Session, p: &Value) -> Result<Value> {
@@ -283,7 +284,7 @@ pub fn specs() -> Vec<CommandSpec> {
journal: true,
};
vec![
spec("path.moveAnchors", "Drag Anchor Points", r#""anchors":[[subpath,knot],…],"move":[dx,dy],"curvature":bool=false (anchors move with their handles; Direct Selection drag. curvature = the Curvature Pen's drag: every smooth knot of the touched subpaths gets its handles recomputed so the curve flows through the anchors)"#.into(), move_anchors),
spec("path.moveAnchors", "Drag Anchor Points", r#""anchors":[[subpath,knot],…],"move":[dx,dy],"curvature":bool=false (anchors move with their handles; Direct Selection drag. curvature = the Curvature Pen's drag: every smooth knot of the touched subpaths gets its handles recomputed so the curve flows through the anchors),"stepName":"Drag Path"? (History step name; the Convert Point tool sends it when it drags a whole path; default "Drag Anchor Points"; any other value is refused)"#.into(), move_anchors),
spec(
"path.moveHandle",
"Drag Direction Point",