PlacedItem.file and PlacedItem.relink() ran file.place.info on the file
to check that it held an image, then file.place or links.relink read and
decoded it again. The image check now runs inside file.place and
links.relink while a script places or relinks an image: a file in no
image format is refused before the document changes, with "The file is
not an image", and a damaged image keeps its own error. The double read
came in with fed96731e2 (#9077).
A test counts the engine's file reads and fails with 2 reads on main.
The bounds getters (position, left, top, width, height and the bounds
arrays) read an item in a document in the back without measuring its type,
while the setters measure it after the switch to that document since
#10538. A script that read t.width and assigned it back could resize the
item, and every geometry assignment switched to the document and back even
when nothing changed.
The getters now measure type not measured yet in a document in the back
for an item that holds type, a symbol instance or a placed document, the
way the switch measures it, and the check is skipped while the document is
unchanged. An assignment equal to the current value of an object without
such content in a document in the back returns without switching
documents, and no undo step is made.
When the Simplify or Smooth slider's preview is refused (no path in the
selection), the engine keeps the interaction open with no preview. Escape
and ui.dialog.cancel only rolled back an interaction whose preview was the
slider's own command, so the edit stayed open after the slider closed and
blocked other dialogs' previews.
Cancel now also rolls back an interaction with no preview, unless a tool
joined it (a Selection drag pressed but not yet moved). The engine records
that join on the interaction and exposes it as
Session::interaction_joined_by_tool.
- A commit or cancel with no drag open no longer ends an interaction for
plug-in events.
- A host query that panics during a handler still puts the session back.
- Handler calls after a replayed command are checked as calls from outside.
- A rolled-back batch puts back the events its opens pushed out of the
32-event queue.
- Installing a plug-in again, the same module included, turns its events
back on; plugin.info's eventsOff follows the same rule.
- A document added before the first check records its baseline.
- Handler failures show in the status bar from their English templates,
translated when shown, and event handler time counts toward the frame
time.
- Tests check that the handler ran in the tested pass, and the script-run
test no longer writes to other sessions' status bar.
A script's addDocument with previewMode OverprintPreview failed: file.new
turned the view on with view.overprintPreview, which scripts may not
run. A script's file.new now asks for the view, and the run turns
Overprint Preview on when it ends; a run that fails does not turn it on.
The images a New Document profile's symbols, patterns and brushes link
to were read under the script's file gate, after the profile's own file
was read outside it, so images beside the profile showed only their
preview. They are now read the way the profile's file is, under the
automation roots in force.
With nothing selected and New Art Has Basic Appearance off, a fill
preview followed by a failed Flood Fill preview left the previewed fill
in the new-art paints, and a commit kept it. The interaction now keeps
the paints from before the previews that build on each other and the
paints the last of them left. A failed preview puts back the first, with
the fields a command outside the previews changed kept as that command
left them.
The Swatches view no longer lets the palette select a swatch by color.
When no swatch is the stop's own, nothing is selected, so a spot or
global swatch of an unlinked stop's color is not shown as picked and a
click on it links the stop.
swatch.edit records each rename with the uid of its document. A preview
records nothing, a failed command.batch puts the record back as it
was, and the session keeps the newest 64 renames. VectorcraftApp::run
and the popover take the record, and the popover's remembered pick
follows a rename of its swatch in its own document, inside a batch too.
The popover tests check the cells the view draws selected through the
panel harness.
A preview that started from the paints saved before an earlier preview
took the selection's appearance cleared that snapshot. When a later
preview then failed, neither the cancel nor the commit after it saw that
the new-art paints had changed, and the previewed fill stayed. The
interaction now records that such a preview ran, and the cancel and the
commit after a failed preview put back the paints it began with.
Two fixes for review threads on this pull request.
The dialog sent an RGB current fill's working components without
keepModel, so in a CMYK document the engine converted the fill to CMYK.
While the shown color is left unchanged, the dialog now also sends
keepModel: true. An edited color converts to the document's model as
before.
With New Art Has Basic Appearance off and nothing selected, a preview
that drew new art took its new-art paints from that art, and the next
preview then put back the paints the interaction began with. A second
rectangle preview after a fill preview was drawn with the starting fill
instead of the previewed one. The interaction now keeps the paints from
before the inheritance and the next preview starts from them. A fill
chosen during the drag updates them too. After a failed preview, a
cancel or a commit puts back the paints the interaction began with.
- Params that are not an object or null are an error on journal and
action replay as well as in a batch.
- A call without `artboards` or `all` records the artboard it filled as
`activeArtboard` for a journal replay; a recorded action leaves it out,
so playing the action fills the artboard active then.
- The command is disabled when the document has no artboards.
- Canceling a Flood Fill preview puts back the new-art paints it began
with instead of taking them from the selection.
Replacing or canceling a drag's preview restores the Appearance row only when
the preview itself changed it, so a row set or cleared during the drag stays.
The dialog clears only its own preview error, and only while it is still the
current status message. The group expansion test checks behavior instead of
source text.
Edit Points Only now leaves out selected paths and groups that are hidden or
locked, themselves or through an ancestor. Group expansion looks up explicit
anchor picks in a set instead of scanning the selection for each path.
Canceling the preview restores the active Appearance row, and a preview or OK
that succeeds clears the earlier status error.
PathItem now takes PageItem's translate, rotate and resize: main's PathItem versions are removed, and resize on a path keeps main's changeLineWidths percent for the stroke weight. Hidden objects are refused, and an identity transform of an empty path checks its Transformation value and does nothing.
- Flood Fill Artboards is disabled, and refused, while a symbol or a
pattern is edited, so the rectangles never land in a definition.
- Params that are not an object or null are refused, also when an
action.batch step is checked before it runs.
- The dialog keeps OK off, with a reason, when Current Fill is chosen
and there is no current fill.
- With New Art Has Basic Appearance off and nothing selected, a paint
preview that is replaced or canceled puts back the starting paints,
so two paint.swap previews commit one swap, while a preview that
takes its paints from new art it selected is tracked on its own.
- Headless tool gestures deliver plug-in events once their actions finish,
and a drag set aside by a command holds events until it ends.
- Documents added in a batch are compared with their state when added.
- Background plug-in loads record the event baseline when they install, or
after commit or cancel when a drag is open.
- Layer snapshots are compared by id through a map.
- Each desktop frame runs at most four handlers across background delivery
and every UI pass, and asks for another frame while handlers remain queued.
While an interaction is open (a move, scale or shape drag, a dialog's
preview, a typing session), the menus' state key left the document
revision out, so the key changed in the frame the interaction began and
the menus rebuilt every row's state for it, on top of the rebuilds for
the press and the release. A rebuild costs about 8 ms on small documents
and about 160 ms with 10,000 objects selected.
An interaction now records the revision it began from, and the key uses
that revision while the interaction is open. The key stays the same as
a drag begins and through its previews, and changes when it ends.
The new test drives a Selection tool move through the whole app and
counts the rebuilds in each frame: one for the press and one for the
release, none as the move begins.
- A color component too large for f32 (c: 1e308, [1e39, 0, 0], gray or
Lab out of range) read as infinite and reached the rectangles; the
command now refuses it with "bad color".
- The dialog's Color option opened on the current fill in display sRGB
and sent it as working RGB, so a document whose working RGB space is
not sRGB got a shifted color. The dialog now opens on the fill's
display color and converts the picked color back to working RGB.
- With New Art Has Basic Appearance off and nothing selected, a
previewed color gave the new rectangles' fill to the new-art paints,
and Cancel or a replaced preview kept it. Both now put back the paints
the interaction began with.
Docs: docs/mcp.md.