swatch.spotOptions and swatch.resetDefaults {replace: true} rewrite the
fill and stroke for new art through map_default_paints, which also runs
for command.batch steps. Two tests now run each command on its own and
as a batch step followed by a rectangle, and check that the default
paints and the rectangles match: a Lab spot link keeps its tint and
takes the Lab values or their CMYK equivalent in both directions, and a
link to a swatch the replace removes is dropped while the color stays.
Both tests fail when map_default_paints skips every interaction.
The progress line for swatch steps in a batch names the two commands and
the new tests.
A gradient stop linked to a spot ink that also carries process plates
(a DeviceN stop opened from a PDF) printed only its spot tint: print
separations and Separations Preview left its Cyan, Magenta, Yellow and
Black plates blank. They now print the stop's plates beside the tint.
With spots printed as process, each process plate prints the stop's
plate layered with the spot tint's process equivalent, as a separated
image's spot plates layer. Plates beside no spot link, or beside
Registration, still print nothing of their own.
The color visitor also skipped a freeform gradient's points, so print
plates kept their display colors and Document Color Mode left them
unconverted. The points are now visited as unlinked colors.
swatch.edit stored a replacement gradient without its placement, so a
radial gradient with an aspect, Alt-dropped on a gradient swatch or
given as `paint`, lost that aspect, while swatch.new keeps it and
applies the swatch with it. A gradient given an aspect without `start`
and `end` lost the aspect in both commands. A replacement pattern kept
the tile transform of the swatch it came from, while swatch.new stores
a pattern untransformed, and `paint: {pattern: name}`, which an Alt-drop
of a pattern fill sends, was refused.
swatch.edit and swatch.new now store a gradient or pattern through one
helper: a gradient keeps its aspect, with or without a vector, and holds
no swatch link, and a pattern is untransformed. swatch.edit takes a
pattern by name, as swatch.new does.
brush.freehand drew the plain path when `brush` named no brush in the
document or was not a string, and drew a pencil stroke for any `style`
other than "brush". It now refuses an unknown name with "no brush named
`<name>`", as brush.apply and brush.setCurrent do, a `brush` that is not
a string, and a `style` other than "pencil" or "brush". The document does
not change and no undo step is recorded. A `brush` left out or null still
draws the plain path.
The Paintbrush skips a tool brush or current brush that has been deleted
and paints with the other, or draws the plain path when neither is in the
document, so a stroke after a brush is deleted is not refused.
Evaluating a layer's Pathfinder or geometry effects asked each member
whether a sublayer below it held a ruler guide, then asked the members
of every selected sublayer or group the same question again on the way
down. A sublayer nested N deep was scanned once per layer or group above
it, so a chain of N sublayers cost N(N+1)/2 scans.
One read walk now looks at each member once at most and records which
members hold or lead to a sublayer's guides, and the move visits and
copies only those. As before, the groups inside a sublayer that holds no
guide are not looked into. The guides taken, their order, their hidden
and locked state, the art left behind and the sharing of untouched
members are the same as before.
Document::guides_to_saved, remove_edit_layer, retain_guides and the
artboard guide moves now call the layer helpers in node/ops.rs
(held_guides, strip_held, map_held), which Node::strip_ruler_guides and
Node::map_ruler_guide_positions already use. The copies in
document_guides.rs (picked_in_layers, drop_picked, edit_picked) are
removed. Picked stays for the walks through objects and opacity-mask art.
Results, guide order, copies kept for undo and the number of nodes each
walk looks at are unchanged.