- move() on an object on a locked artboard throws "cannot move objects
on a locked artboard", as remove() refuses to delete such an object.
- move() works out the index node.move puts the object at, with art
kept below the layer's ruler guides, before it decides whether the
object moves. Before, moving the topmost art to the top of a layer
with ruler guides ran node.move and added an undo step that changed
nothing.
edit.copy, artboard.copy and artboard.cut now have the clipboard saved
before them, as edit.cut and command.batch do. Before, a Copy whose
result could not reach the script was put back without its clipboard,
so the copy stayed on the clipboard and the run reported copied: true.
- controlBounds gives the visible bounds together with the anchors and
direction points of the paths in the object, taking the members its
geometric bounds take. A blend, envelope or other live object gives
its visible bounds. Before, every object gave its visible bounds.
- A New Document profile is opened once. After the open, the roots in
force must still allow its path and the path must still name the plain
file that was opened, so a file put in its place between the checks
and the open is not read.
- Array methods visit every index of an object of a host class with an
indexer, also past 4,096 indices. Before, a long range was listed from
the object's properties, and its indexed elements were skipped.
- An assignment to a document's selection checks each item against a set
of the ids taken, so a long list is not searched once for each item.
- A test shows that a failed selection assignment leaves the selection
within the same run, and the link test removes its files when an
assertion fails.
- A command whose result cannot reach the script is put back, and the
run counts its Copy or Cut only when the clipboard keeps it. Before,
a put-back command.batch left its copy on the clipboard, and a put-back
Cut after an earlier copy still gave the report copied: true.
command.batch now has the clipboard saved before it, as edit.cut and
action.batch do.
- concatenateMatrix and the other concatenate functions sum each value
past the range of a number when a product overflows or falls below
the normal range next to another product, so [2^600, 2^600, 0, 1]
then [2^600, 0, -2^600, 1] gives [0, 2^600, -2^600, 1] instead of a
RangeError, and two products of 2^-1075 sum to 2^-1074.
- getRotationMatrix and concatenateRotationMatrix reduce the angle with
a remainder that keeps its sign, so -89.99999999999999 is not rounded
to the quarter turn 270; -90, -180 and -270 stay exact.
- docs/mcp.md says isEqualMatrix and isSingularMatrix give true or
false, not a new record.
A New Document profile file that is a link or a folder is no longer read:
the read is exempt from a script's file gate, which never checked where a
link leads. file.new reports it as a profileError with the reason "not a
plain file".
Reading a DocumentPreset setting now counts the value it returns toward
the data a run may pass, as assigning it does, and addDocument counts the
preset's settings before copying them.
The removeAll() test on a locked artboard now also holds an object on an
unlocked artboard and checks it is still there after the call throws.
- The question a run asks before a script sets ShowExternalJSXWarning to
false has a row in every complete-message catalog, with a test that
each of them translates it.
- Russian and Ukrainian name File › Scripts › Other Script… as another
script rather than another writing system.
- A preference key's limit is stated as a length of 1 to 256 UTF-16 code
units, the count the code checks, in the error and in docs/mcp.md; a
test covers keys of characters outside the Basic Multilingual Plane.
- The host name check lists Preferences, the matrix functions and
app.copy, cut and paste; the preference setters and removePreference
carry the checker's preferences id.
A script that copies with app.copy() or app.cut(), or with edit.copy,
edit.cut, artboard.copy or artboard.cut through vc.run (also inside
command.batch or an action), and ends with the clipboard still holding
what it copied, now has copied: true in its report. The desktop app then
offers the clipboard to other apps as Edit › Copy does, for runs in the
app and for runs automation takes to their end at once.
- Session counts each Copy or Cut that fills the clipboard and marks the
clipboard as holding a copy; a clipboard.import... command clears the
mark. A Copy that leaves the clipboard empty is not counted.
- command.batch, a plugin call and a script command that fails put the
count and the mark back with the clipboard, so a rolled-back Copy is
not reported.
- docs/mcp.md and the script.run params text describe copied.
PageItem.remove() and PageItems.removeAll() checked only whether the
object and its layers and groups were shown and unlocked, then passed the
ids to edit.clear, which deletes named objects without checking artboard
locks. Both now throw "cannot delete objects on a locked artboard" with
the object ids and delete nothing, as art on a locked artboard is not
editable elsewhere in the document.
A color a library pattern's art brings now skips the library's numbered
names while the pattern is imported, instead of being renamed after the
import. The rename also rewrote every other paint in the document linked
to the name the import first gave, such as art still linked to a deleted
"Ink 2", so adding the pattern changed that art. Now the names are held
with placeholder swatches during the import and removed afterwards, and
links that were already in the document stay as they were.
A pattern whose art brings both "Ink" and the library's "Ink 2" keeps the
library's "Ink 2" under its own name when the document gives "Ink"
another color, and the library's "Ink" takes the next free name. A library
pattern with a numbered name, such as "Tiles 2", keeps that name when the
document does not use it.
A global or spot color that a library pattern's art brings under a
numbered name no longer takes a name the library gives another swatch.
Before, adding a pattern whose art uses "Ink" to a document with another
"Ink" brought the color as "Ink 2" even when the library has its own
"Ink 2"; adding that library swatch next then came in as "Ink 2 2". The
brought color now takes the next free name the library does not use
("Ink 3"), and every paint linked to it follows the new name, so adding
the library's "Ink 2" next adds it under its own name and adding both
again adds nothing.
A color the pattern's art brings or takes is the color a library tint
or gradient links to only when it has the library color's paint and its
process, global or spot kind, as for the other lookups in the same add.
The test a_numbered_copy_named_like_another_library_color_is_found now
makes the blue "Ink 2" itself, as an earlier version's pattern add left
it, since a pattern add no longer gives that name.
Setting selected to true or false runs select.add or select.toggle for that one object, so the
other objects keep their direct-selected anchors and segments and the key object. Before, it
replaced the selection with whole objects.
A press keeps the pointer and the snapped point for the end of the piece it adds. When Alt
changes the action during the press, the end goes through the protractor's tick again for the
new action, so a continuous arc that snapped to a tick and becomes a sharp-corner arc ends at the
pointer, and a piece that becomes a continuous arc goes onto the tick, without waiting for the
next drag. This also covers a press that has not dragged.
- new DocumentPreset() now makes an object of the DocumentPreset class whose settings the run
keeps, so addDocument refuses a plain object, one with a typename of DocumentPreset included,
with a TypeError naming presetSettings.
- When file.new reports a profileError, addDocument throws an error that names the profile and
the reason, and the document made with the defaults is put back.
- A script's file.new reads the New Document profile file in the app's own profiles folder;
the automation roots in force still apply. Before, the script's file gate refused the folder,
so a scripted addDocument never used an edited profile.
Docs: docs/mcp.md.
A continuous arc that starts a path has no direction to follow and
sweeps the arc size, as a sharp-corner arc does. Moving its end onto a
protractor tick put the end on a circle the drawn arc does not follow,
so `tick_end` now gives no tick for it.
The hover keeps the snap settings it was made with (`SnapSettings` in
guides/snap.rs: the window, zoom, snapping options, tolerances,
Alignment Guides and construction angles). After one of them changes
under a still pointer, the hover's rubber band, protractor, distance
label and Smart Guides are hidden until the pointer moves, also through
a press, so the preview shows no point that a click would not place.
A press also drops the hover, so after a click puts an arc's end on a
tick no preview runs from that end back to the pointer. While the
pointer hovers, the tool asks the canvas to hover it again when the
view, the document or the selection changes (`wants_rehover`).
remove() on an object that is hidden or locked, sits in a hidden or locked layer or group, or is a group holding such an object now throws and deletes nothing, the same rule pageItems.removeAll() applies. docs/mcp.md states both rules and that width and height scale along the page's axes.
Checking whether a layer's pixels are all fully transparent no longer counts
its transparency against the memory allowed for the whole import. The layer
is counted where it is drawn, so an import that fits no longer fails because
the check counted the same pixels first.
A rotated rectangle given a width and then a height through the scripting object model reads back the values set, its geometric bounds have that size, and other objects stay as they were. The resize doc comment names the page's axes.
`app.preferences` reads, stores and removes values by key with the
type they were set as. Keys that are not VectorCraft preferences are
kept with the preferences under `scriptPreferences`, so they last
across runs and restarts, and a failed or stopped run puts them back.
Keys, values and the store have size limits, a setter refuses a value
of the wrong type, and two windows that set different keys keep both
when the preferences file is saved.
- `ShowExternalJSXWarning` is the warning before a picked script runs.
Setting it to true, or removing it, turns the warning on. Setting it
to false opens a confirm with No as its default and turns the warning
off only after Yes; a run that cannot show a dialog throws and
changes nothing. This confirm is VectorCraft's own rule.
- `app.getIdentityMatrix`, the `get…Matrix` and `concatenate…Matrix`
functions, `invertMatrix`, `isEqualMatrix` and `isSingularMatrix`
work on plain `Matrix` records and never change the records passed
in.
- `app.copy`, `app.cut` and `app.paste` run `edit.copy`, `edit.cut`
and `edit.paste` on the active document inside the run's
transaction.
Docs: docs/mcp.md, docs/target-app-parity.md.
A layer mask white outside its rectangle now hides a layer when the mask is
0 over every pixel the layer draws, even where the rectangle leaves fully
transparent pixels out. A group's mask is checked the same way against the
pixels of the group's layers, unless the group holds an adjustment layer or
a fill that stores no pixels. A base merged with the layers clipped to it
counts as drawing nothing when its mask hides the base. A check that was
skipped for lack of memory is made again later instead of being kept.