Scripts: points of a path in a selected group read as selected

PathPoint.selected and PathItem.selectedPathPoints now count a path as
selected as a whole when a group or compound path that holds it is
selected, as the canvas shows its anchors. Assigning
PathPointSelection.NOSELECTION to a point of such a path throws an
error that says it is not available yet, and ANCHORPOINT on it runs no
command, so the selection is not left holding both the group and one
of its paths.

Selecting a point of a guide while guides are locked throws an error
instead of running a selection that the guide lock undoes.

Assigning guides = false on a path that cannot be selected (outside
the isolated object) throws Cannot edit, as guides = true does.

Reading PathPoint.selected no longer writes the point changes waiting
for its path unless they add or remove points, so a loop that reads
selected and moves the selected anchors writes the path once.
This commit is contained in:
dotCooCoo committed 2026-11-23 13:14:01 -08:00
1 parent dd74879624
commit fbc057f8b0
3 files changed
+162 -33

No files matched your search

+9 -7
View File
@@ -2734,13 +2734,15 @@ app through the global object `vc`, and writes to the Script Console and runs ot
than the object model changed the path's points (a command run with `vc.run`, such as `path.setAnchors`,
`object.move` or `edit.undo`); points stay valid through the object model's other changes to the path or to an
object that holds it, such as `translate()`. Every point of a path selected as a whole is a selected anchor point,
and the endpoints of selected segments are not; a path is selected as a whole only when it is itself selected, not
when a group that holds it is. Direction handles are not selected on their own, so assigning `LEFTDIRECTION`,
`RIGHTDIRECTION` or `LEFTRIGHTPOINT` to `selected` throws an error that says it is not available yet, and selecting
a point of a path that cannot be selected throws `Cannot select`. A clipping path cannot be made a guide, and
`guides = true` on one throws an error; assigning `guides` on a path inside a compound path throws an error that says
it is not available yet, on a path that is hidden, locked or cannot be selected throws `Cannot edit`, and while
guides are locked throws an error for either value. Color components left out
and the endpoints of selected segments are not; a path in a selected group or compound path is selected as a whole.
Direction handles are not selected on their own, so assigning `LEFTDIRECTION`, `RIGHTDIRECTION` or `LEFTRIGHTPOINT`
to `selected` throws an error that says it is not available yet, and so does assigning `NOSELECTION` to a point of a
path in a selected group or compound path. Selecting a point of a path that cannot be selected throws `Cannot
select`, and selecting a point of a guide while guides are locked throws an error. A clipping path cannot be made a
guide, and `guides = true` on one throws an error; assigning `guides` on a path inside a compound path throws an
error that says it is not available yet, assigning either value on a path that is hidden, locked or cannot be
selected throws `Cannot edit`, and assigning either value while guides are locked throws an error. Color
components left out
count as 0, `new
cmykColor()` makes a `CMYKColor`, `LabColor.l` is 0 to 100 and `a` and `b` are -128 to 128, and a component out of
range throws a `RangeError` when the color is assigned, with nothing changed. A component reads with the fewest