- The Image Trace panel's lookup test skips an Image Trace object's source
image, as imageTrace.make does since trace() came in.
- A save of several files refuses a path the file access in force refuses
before any file is written, whatever writer the caller gives.
- move and duplicate look a page item up through its class, so a PlacedItem
that was embedded is stale as the relative object.
- PLACEATEND into an Image Trace object puts the object directly above the
source image, which stays the first child.
- controlBounds takes in the anchors and Bezier handles of the item's paths.
- The file of a PlacedItems.add() result is stale once its document closes.
- Assigning PlacedItem.file reads the placed image's id from the command's
own result, so an id above 2^53 binds and clears exactly.
- The enumerations the save and export option defaults name are registered,
with the members the scripting constants page lists.
- A tracing replaced twice and then undone is followed to the one the
document holds.
- Choosing the artboard layout in force again keeps a preset's rows.
- docs/mcp.md and docs/gaps.md describe controlBounds, a null preset for
addDocument, the view options and scripted tracing.
`PlacedItem.trace()` and `RasterItem.trace()` run `imageTrace.make` with the
Default preset and return the Image Trace object as a `PluginItem`. Its
`tracing` is a `TracingObject` with the source image, the path, anchor and
color counts, the image's resolution, `expandTracing()`, `releaseTracing()`
and a `TracingOptions` object. Assigning an option or loading a preset traces
the image again, keeping its source image and view; a value the tracing
already has runs no command. Option values are checked for type and range
before any trace, and nothing changes when one is refused. Options with no
VectorCraft setting and `expandTracing(true)` throw. `storeToPreset` returns
`false` for a built-in preset name or `Custom` and throws for any other name.
A tracing that was expanded, released, deleted or traced again by a command
is stale. The source image is reached through `sourceArt` and is not listed
in `pageItems`, `placedItems` or `rasterItems`, and the name of a tracing
cannot be changed from a script. With a script running, `imageTrace.make`
stops at the run's stop request.
Setting `File.hidden` stores the new path with `set_path`, since the path is
held in the object's class on this branch.
Docs: docs/mcp.md, docs/target-app-parity.md.
Assigning `file` to a `placedItems.add()` result without a file checks the
file and places the image; only assigning `matrix` to such a result throws
`PlacedItem.file is required`. A stale item throws `Stale page item` for
both setters.
placedItems.removeAll() and rasterItems.removeAll() checked only whether
each image 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 image ids and delete nothing, as pageItems.removeAll()
does.
Assigning matrix read the value before the item, so a stale image or an
add() result without a file threw the matrix error. Assigning file to an
add() result that was placed and then embedded threw "PlacedItem.file is
read-only: use relink". Both now check the item first and throw "Stale
page item" or "PlacedItem.file is required".
A File that a host class member returns now charges its new path string
to the script heap, in the same reservation as the File object.
docs/gaps.md G6 and the M13 row in docs/roadmap.md list the placed and
raster image classes; docs/mcp.md states the removeAll and setter rules.
A read of a host class on another branch of the same family with the same
handle makes a new object instead of switching the held object's class. A
class and its ancestors and descendants still share one object, so a placed
image read through placedItems and through pageItems is the same object, and
each branch's held object keeps its identity on later reads.
After p.embed() or links.embed, reading rasterItems or pageItems gives a new
RasterItem object, and the PlacedItem object the script held throws
Stale page item.
Scripts get Document.placedItems and Document.rasterItems, the linked and
embedded images of a document, with length, [i], index, getByName and
removeAll. PlacedItems.add() gives a PlacedItem whose file, assigned once,
places an image linked through file.place. PlacedItem has file, relink(file)
(links.relink), embed() (links.embed), matrix and boundingBox. RasterItem
has bitsPerChannel, channels, imageColorSpace and transparent, read from the
header of the encoded pixels, and colorizedGrayscale, embedded, file,
status, matrix and boundingBox. Assigning matrix runs object.transform. The
ImageColorSpace and RasterLinkState enumerations are added.
A file to place or relink must be a File the script may read, checked as
app.open checks its file, of at most 256 MiB, holding an image; its size is
read first, and the error does not name a path the script may not read.
Reading file of an image linked outside the script's read scope throws
Script file access denied. A matrix with a value that is not finite, no
area, or a corner outside the canvas throws with nothing changed. After
embed() the PlacedItem is stale and rasterItems lists the image under the
same id; a missing linked file stays linked and throws. A run keeps at most
1,024 PlacedItems.add() results.
contentVariable, trace, colorants, colorize and overprint throw an error
that says they are not available yet.
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 save or export to a file that a File object holds open for writing throws "Script file is open for writing", and a command the script runs does not write such a file besides the one named (an SVG's images), so the bytes the File writes at the end of the run do not replace the output. horizontalScale and verticalScale take 1 to 776.19, since a raster export writes at least 0.01 pixels per point.
The script checker reports a document's saveAs and exportFile as file writes, and the host name check lists the save, export and open names, option classes and enumerations.
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.
Scripts save, export and open documents through Document.saveAs,
Document.exportFile and app.open, with IllustratorSaveOptions,
EPSSaveOptions, PDFSaveOptions, ExportOptionsPNG24, ExportOptionsJPEG,
ExportOptionsSVG and a PDFFileOptions record, the ExportType and related
enumerations, and app.userInteractionLevel. Each method runs file.saveAs,
document.export or document.open inside the run's transaction.
- A File argument reaches the host as its path only when the File class
made it: the path is held in an internal slot that scripts cannot set,
and a plain object that imitates a File is refused.
- Each path is checked as a File opened for reading or writing would be,
before the command runs, and the command's own reads and writes are then
held to the script's grants, leaving out the open documents' files.
A read-only file is not written over.
- Options a command maps are applied; a listed option that is not mapped
is accepted only at its documented default, and any other value, a bad
type or an out-of-range number throws before anything is written.
Without options, saveAs to a .ai, .eps or .pdf path and exportFile as
PNG24, JPEG or SVG use the defaults a new options object holds. With
pDFPreset named, a PDFSaveOptions option still at its default keeps the
preset's value. A raster export at 100% has one pixel per point.
- An export or save that writes several files, such as an SVG that writes
its embedded images beside it or an EPS with a file per artboard, checks
every path before writing the first.
Docs: docs/mcp.md, docs/target-app-parity.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.
While an arc is drawn, by a drag or as the piece the next click adds, the
Quick Pen tool shows a protractor around the arc's center: a tick every 15°
from where the arc starts, a longer one every 90°, and one where it ends. The
piece the next click adds shows its protractor only while Enable Rubber Band
for the Pen tool shows that piece.
With Smart Guides on, the end of a continuous arc snaps onto the nearest tick
of its protractor, on the same circle, when the tick lies within the snapping
tolerance of the pointer, no other Smart Guide snaps the point, and neither
Snap to Grid nor Snap to Pixel snaps drawn points. A sharp-corner arc sweeps
its arc size, so its end does not snap. Shift does not constrain Quick Pen
points, so it does not change the snapping. The protractor, its 15° step and
the snapping are VectorCraft's own behavior.
The Smart Guides targets now also report whether a point landed on one of
them (`Targets::snap_hit`), so a target whose label or line is hidden still
takes precedence over a tick.
Adds tests for the arc's circle, the tick snapping by drag and by click and
its precedence, and the protractor during a drag and while hovering. Also adds
tests of existing Quick Pen behavior: a point snapping to a Smart Guide, and
the distance label shown while hovering.
A pass-through group's adjustment layers count as kept to change what is
below the outer pass-through group only when nothing below that group in
the outer one draws, as for adjustment layers directly in the outer group.
Before, a layer merged above them for its blend mode merged them applied
but the import counted them as not applied.
docs/mcp.md now says when a layer's mask hides all of it.
The host name test now has rows for app, the document model classes and the enumerations the script host adds. zOrder on a path inside a compound path throws an error and leaves the document unchanged, as duplicate does.