resize and transform with changeLineWidths equal to the scale now scale the
strokes, dashes and effects of a path with no anchors, as they do for a path
with anchors. A member with no anchors of a compound path or compound shape
that shows a pattern is refused when the call transforms patterns, as a path
with a pattern of its own is.
node.move's description and docs/mcp.md now say that a compound path on a
locked artboard takes a path while it is new art there and still selected.
rotate, resize and transform on a path with no points returned success
after setting only the stroke weight, even when the call asked to
transform a fill or stroke pattern the path uses. The pattern stayed as
it was. Such a call now throws "the object has no bounds", as it did
before empty paths were accepted, and leaves the document unchanged.
docs/mcp.md states the exception.
Document.pathItems.add() and the shape creators passed the active layer
as onLayer even when it was locked or hidden, so path.create refused it
and the script threw, while textFrames.add() and the app's own creation
commands put the new art on the topmost shown, unlocked layer. The path
creators now choose that layer the same way. While an opacity mask,
pattern or symbol is being edited, they use that edit's layer, and a
locked or hidden editing layer still throws. When every layer is locked
or hidden, the call throws and makes no path.
The creators came in with #9304.
While Global Edit is on, an object model edit of one member (or a move
of a group that holds it) is given to the other members, but the check
that marks read PathPoint handles stale only looked at the edited
object's own subtree. A script that read a point of another member kept
a valid handle after the edit, even when an undo then put the member
back. The check now also looks at each Global Edit member, or the
outermost Objects on Path group that holds it, and skips subtrees the
command left as they were. The stale-point check came in with #9288.
Docs: docs/mcp.md, docs/target-app-parity.md.
After a script reads a path's points, each command makes the run look
through the changed layers and groups of the document for those paths.
That look was not counted toward the script's operation budget, so a
loop of commands on a large layer did unbounded work. It now charges the
objects it looks at, as the layer scans in layers.rs do.
- The look pairs each object with the one of the same id under the same
parent now, and lists the document once for a group that moved, so no
object is searched for through the whole document.
- A document none of whose read paths remain is no longer looked at.
The look was added in #9288.
An edit to a Shaper source regenerates the group's paths. When the
regeneration drops a generated path and makes none, the document's next
id does not change, so the kept list of pathItems still held the removed
path. Edits to a path inside a Shaper group no longer keep the list.
- pathItems.removeAll() now throws and deletes nothing when it would delete
the clipping path of a group or layer that keeps other objects, as
pageItems.removeAll() does. The check is shared with the art collections,
and the document's collection counts compound paths that edit.clear
empties and deletes.
- rotate, resize and transform check changeLineWidths at the
transformation's own scale with changePositions false before the early
return for a path with no points, so an empty path is refused as one with
bounds is instead of having its stroke weight set.
- docs/mcp.md describes both.
CI's test-lint step failed the gate's sixth test shard: the all-unguarded
rule flagged reading_and_moving_points_counts_the_subpaths_a_few_times,
whose assert!(…all(…)) would also pass on a path with no anchors. The
test now asserts the path still has 1000 anchors first.
- A layer's, group's or compound path's pageItems, pathItems, groupItems,
compoundPathItems and layers, and the document's artboards, look up a key
such as "-1" or 1.5 as a name, as the document's pageItems does.
index() still takes a number as a position only.
- pageItems.index() on a layer, group or compound path reads that
container's list instead of throwing a type error.
- An Artboard read before File > Revert throws Stale artboard instead of
changing the loaded artboard with the same id. A retained artboards
collection still lists the loaded artboards.
- Opening a path with some of its selected segments left drops the anchors
that only ended the removed segments and keeps the segments that are left.
- PathPoint.selected writes waiting point changes first when they replaced
the path's points, so the read matches the selection after the write.
- PageItems.parent is described as any container.
PathItem.closed on an empty path checked only that the path was
editable, so an empty path in a group on a locked artboard accepted
closed = true. The setter now uses the same check as other path edits;
an assignment of the value the path has still does nothing.
Also splits the M14 roadmap row that a merge joined with the next row.
- PathItem point, paint, stroke and transform changes on a path on a locked
artboard now throw `Cannot edit` and change nothing, as the PageItem
setters do. `pathItems.removeAll()` deletes nothing when a path is on a
locked artboard, as `pageItems.removeAll()` does; it used to delete them.
- `move` and `duplicate` with `PLACEAFTER` and the clipping path of a clip
group or clipping layer as the relative object throw instead of putting
the object above the clipping path, or reporting success without moving it.
- `zOrder` counts the art above a clipping path and below the layer's ruler
guides, as the Arrange commands do, so a method that leaves the object
where it is runs no command.
Docs: docs/mcp.md.
- path.setAnchors on a member of a compound path drops the compound
path from the selection too, unless another member still has anchors
or segments selected, so a following Join does not act on the
unselected sibling paths. A script's put-back selection follows the
same rule.
- Opening a path in a script drops its segments and the anchors that
only ended them; other selected anchors stay selected.
- Removing a point that waits to be written with replaced points no
longer puts the old selection back on the new points.
- An objectOnly paint during an open interaction also restores the paint
waiting for the commit, so it no longer reaches Recent Colors.
- setEntirePath([]) on a closed path keeps an empty closed subpath, so
the path stays closed.
- A character or paragraph style's applyTo throws Cannot edit, with
nothing changed, on a hidden or locked text frame or one on a locked
artboard, as other text edits do.
- PageItem.transform with changeLineWidths at the matrix's own scale sets
the stroke weight of a path whose paint the compound holds, as resize
does.
resize and transform set that weight by the scale itself, and an explicit
100 keeps the weights even for a scale within the tolerance of 100%.
- A changeLineWidths of 0 no longer matches a tiny scale; a positive value
is compared with the scale relative to its size.
- translate refuses an offset past the canvas only when the call moves the
object or a pattern it uses; a non-finite offset is still refused.
- Number conversion of preference text no longer trims U+0085, as
JavaScript does not.
- A real preference changes between 0 and -0: values are compared by their
bits in the setter and when the run's keys are merged.
- A clipboard.importSvg whose result cannot reach the script puts the
clipboard back.
- Moving an object works out its index without copying the list of its
siblings.
- The app's question before the external script warning turns off is known
by the confirm the app opened, not by its text, so a script's confirm
with the same text answers Yes through automation and is not translated.
- docs: only calls that move or reshape the object run
object.transform, and transform sets a compound member's stroke.
Writing a path's points removes it from the selection only when it, its
anchors or its segments are selected, so emptying an unselected path keeps
a targeted layer. Removing a point that changes the selection puts back the
current layer and the highlighted Layers rows. The New Document test reads
fractional rows as rounded, as file.new does.