Selection-only commands take ids: the objects are selected first (#2130)

object.group, ungroup, the clipping mask and compound path Make/Release,
the Arrange commands, lock, hide, edit.duplicate, object.move, rotate,
scale, reflect, shear and the Pathfinder commands acted only on the
selection, so a script had to send select.set first. Given ids, they now
select those objects (select.set, with its checks) and run as on the
selection, in the same undo step; without ids nothing changes.
This commit is contained in:
Gert Pellin
2026-10-16 04:44:50 +07:00
committed by bflatastic
parent e6b28f0e80
commit e7aacec852
5 changed files with 310 additions and 42 deletions
+10 -10
View File
@@ -22,7 +22,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Unite",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::Unite)
),
@@ -31,7 +31,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Minus Front",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::MinusFront)
),
@@ -40,7 +40,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Intersect",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::Intersect)
),
@@ -49,7 +49,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Exclude",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::Exclude)
),
@@ -58,7 +58,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Divide",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::Divide)
),
@@ -67,7 +67,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Trim",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::Trim)
),
@@ -76,7 +76,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Merge",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::Merge)
),
@@ -85,7 +85,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Crop",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_multi,
|s, _| run_pf(s, PathfinderOp::Crop)
),
@@ -94,7 +94,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Outline",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::Outline)
),
@@ -103,7 +103,7 @@ pub fn specs() -> Vec<CommandSpec> {
"Minus Back",
["Window", "Pathfinder"],
None,
"{} operate on the selected objects (back → front) → {ids}",
"{ids?: [id…] (selected first; default: the selection)} operate on the selected objects (back → front) → {ids}",
has_selection,
|s, _| run_pf(s, PathfinderOp::MinusBack)
),