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.
A numbered copy of a library tint found in the document now brings
back the deleted global or spot color it links to, as a tint of the
library tint's own name does. A deleted color that the call also picks
is added before the other new swatches, so a pattern added earlier in
the call cannot give its name to another color and leave the found
tint linked to the wrong one.
A picked pattern the document already has is probed once: the probe
gives both its name in the document and the colors its art takes,
instead of a presence check, a second import into a copy and a third
presence check.
A library tint or gradient counts as already in the document only when
each color it links to is there. When the document's tint of that name
links to a color the document no longer has (deleted without unlinking),
the color comes back under its own name and is listed in `added`.
A picked pattern the document already holds keeps the copy of a color
its art takes (a numbered copy the library also names), and the picked
tints and gradients of that color link to it, so adding the pattern and
the tint again adds nothing. Without such a pattern, a numbered copy the
library also names stands for that library swatch alone.
docs/mcp.md also states that a pattern pasted with Merge for some colors
and Add for others is added again as a copy.
swatch.library.add linked a library tint to the wrong color in two cases.
When the document had a process color with the same name and paint as the
tint's global color, the global color counted as already present and the
tint linked to the process color. When a tint was added without its global
color and the document had another swatch of that color's name, the tint
linked to that swatch.
- A library color counts as already in the document only when the
document's color of that name is the same kind: process, global or spot.
A global color whose name the document gives a process color now comes
in under a numbered name, and its tints link to that copy.
- A global or spot color that an added tint or gradient links to, and that
the document does not have, now comes in with the tint or gradient. It
keeps its own name when that name is free and gets a number otherwise.
added lists it after the picked swatches.
- A library tint is not the document's tint of the same name and paint
when the document's swatch of the base's name is another color or kind.
- A tint that a pattern brought is used for a picked library tint only
when the color it links to is the library color's kind.
When a library tint waits for a color that a pattern's art brings,
swatch.library.add learns the color's name by importing the pattern into
a copy of the document. The import into the document now confirms those
names: when it gives a color another name, or none, the tints linked
from the copy are linked again.
- library.use and Add to Swatches report an error from the import that
merges a pattern's colors instead of falling back to adding them.
- The params text, docs/mcp.md and docs/target-app-parity.md say that a
tint or gradient links to the numbered copy its global or spot color
comes in under or already has, and name a gradient test.
- The new code uses the HashMap import, and one helper relinks the
added tints and gradients at both places that did it.
A library tint or gradient whose global or spot color comes in under a
numbered name now links to that copy whichever order the swatches are
picked in, when the color was added by an earlier call, and when a
pattern's art brought the color or took the document's copy of it.
Adding the same tints again finds the ones added before.
- Each tint's or gradient's color is looked up for itself before
anything is added, past a process swatch of the same paint and past a
color group of that name. A numbered copy that the library's own
swatch of that name is stays that swatch's, and a new copy skips the
library's other names.
- A tint links to a global or spot color of the same kind only, and to
a color this call picks rather than to a copy a pattern took.
- Links are set as soon as the color's name is known. A tint waiting
for a color that a pattern's art brings learns its name from an
import into a copy, so the pattern does not add a second tint.
- A swatch a pattern brought takes a picked swatch's place only when
its colors link where the picked one's do.
- A stop linked to the Registration swatch counts as linked.
- library.use, Add to Swatches and the reuse check share one import
probe (patternlib::probe_import), and the probed copy is kept instead
of importing a second time.
Docs: docs/mcp.md, docs/target-app-parity.md.
- With transparent pixels, a fixed palette's colors mapped to
transparent share the transparent pixels' slot, so at Colors 256 all
255 opaque colors keep their entries.
- The preview's mappedToTransparent lists a color mapped to transparent
that did not fit in the fixed palette when its pixels became
transparent.
- When Colors leaves a fixed palette fewer slots than it has opaque
colors, shifted colors keep their slots first, then locked ones, then
the others in palette order. The file keeps the palette's order.
- quantize::nearest_entries hands each pixel's entry to a callback
instead of collecting one per pixel.
- A GIF lossy test with one fixed entry of three.
Docs: params text, docs/mcp.md.
A linear dimension line placed near another dimension's line lands on its
level only when that line is parallel. Before, the check compared the two
directions only, so a long line at a slight angle passed it: with its first
end within the snapping tolerance, the new line landed on a level the other
line had already left, and the guide ran at an angle between the lines. A
line is now parallel when it moves off its level by no more than 0.000001 pt
across the span of both lines.
A level that would put the line more than 1,000,000 pt from its points is
passed over. Before, the tool took it, the preview failed validation and
was not sent, and a click committed the earlier preview position. The next
level within reach is taken instead, or the line goes where the pointer is.
The level guide also needs Smart Guides on when it is drawn, so turning
Smart Guides off before the next pointer move hides it.
The nonparallel case in the placement test now puts the pointer within
reach of the first line's end, so it fails without the parallel check, and
the guide test expects exactly one guide.
effect.setParams compared a Pathfinder effect's values other than its
Pathfinder Options exactly, so a mixingRate of 50 over a stored 50.0
counted as an edit and recorded an undo step. A float now compares with
any number by value, and two integers still compare exactly.
Since the change that brings a library pattern's global and spot colors
under a numbered name ("Ink 2") when the document gives the name another
color, adding the same pattern or color again added more copies, and
Use Library Item still linked a pattern's art to the document's own
color of that name.
- A library color whose name the document gives another color is the
document's numbered copy with the same color, so adding it again adds
nothing. A numbered name that the same call also picks is not shared.
- A pattern the document holds with its art linked to the document's
own color of a name, as pasting with Merge leaves it, is reused
instead of coming in again as "Squares 2".
- `added` lists the colors a pattern brought, after the picked swatches.
- A library tint added with its base color links to the base's name in
the document, and a later add finds it there.
- library.use brings a pattern's colors the same way.
Docs: docs/mcp.md.
colored_revolve_faces_leave_no_alpha_holes_at_one_to_one compared each
representation only with its own 3x render, so a 60% opacity lost or
applied twice by SVG or PDF import passed at both scales. The test now
also reads the alpha inside the body: 153 within 3 levels with a fill
opacity of 60%, 214 within 3 levels with 60% gradient stops (front and
back faces at 60% each), and 255 when opaque.
In Draw Behind, an Alt-drag of whole objects with the Selection or Direct
Selection tool now puts each copy directly below its own original, in the
original's group or layer, and selects the copies, as the drawing modes help
page lists duplicating by Alt-drag among the actions Draw Behind applies to
(https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/learn-drawing-basics/drawing-modes-overview.html).
The copy of a clip group's or clipping layer's clipping path goes directly
above it, so the clipping path stays the bottom object.
- object.transform takes drawBehind (with copy); the tools send it while Alt
is held. A value that is not true or false is refused.
- Draw Normal, Draw Inside, object.move, the transform dialogs' Copy,
Duplicate and Transform Again keep putting copies above.
- Document::insert_below puts nodes directly below their anchors in one pass.
Docs: docs/mcp.md, docs/target-app-parity.md.
docs/target-app-parity.md gets a line for the file.write report on a
File object's length, hidden and readonly and for the test that lists
every name the script host adds, with the tests that cover them. The
test's comment on vc no longer names another app.
Setting a File object's length truncates or pads the file, and setting
readonly or hidden changes it, but script.check reported no outside
category for those assignments. It now reports file.write and
filesWritten for them: plain and compound assignment, ++ and -- before
or after, and the property name as a string literal in brackets.
A new integration test lists every global and member the script host
adds to the JavaScript engine (the own properties of the global object,
of each object or function it holds and of each function's prototype,
compared with a plain engine) and fails when one has no row. Each name
that reaches outside the document has a probe script, and the test
checks that script.check gives it the expected outside id. vc is listed
as not checked: script.check reads scripts written for the reference
app's scripting, and what vc.run does depends on the command. The test
also checks that the checker lists every preprocessor directive the
host reads, through the new DirectiveName::ALL.
File object properties:
https://extendscript.docsforadobe.dev/file-system-access/file-object/
A folder load checked each .wasm path and then opened it with a blocking
open. When a named pipe replaced the file between the two, the open held
the load until something wrote to the pipe, and with it startup or a
prefs.set of the folder. On Unix the file is now opened
without waiting and without making a terminal the controlling terminal,
and the opened file is checked again: anything that is not a regular file,
or is over the module limit, is refused and listed in the folder report.
A folder load still reads at most 1,000 .wasm files, the first by file
name, and now holds only those paths while it lists the folder. The
files past the first 1,000 were dropped and not reported; plugin.reload
and plugin.list now return their count as leftOut. An error while the
folder is listed fails the load, as an error opening the folder does,
instead of dropping the entries after it.
* refactor(cdr): depend on shared craft-cdr from craft-libs (#1665)
Replaces the local crates/cdr (vectorcraft-cdr) crate with craft-cdr
from storytold/craft-libs#2697 (storytold/craft-libs#778), keeping
VectorCraft's document/artboard/layer/shape mapping in crates/engine.
Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
* build(cdr): pin craft-cdr to craft-libs main (75d179f8df)
* build(cdr): pin craft-cdr to craft-libs main (9b28b56bc7)
* docs(cdr): point CDR/CMX provenance and test paths to craft-cdr
---------
Co-authored-by: dotCooCoo <RobertLeeLW@gmail.com>
shape.flare took the rings' end point only when both x2 and y2 were
numbers. Given one of them alone, it dropped it and placed the end point
from pathLength and direction instead. It now refuses the call with
"missing number `y2`" (or `x2`), as shape.editFlare already does, draws
nothing and adds no undo step. With neither, or both null, pathLength
and direction still place the end point.
Saved flare settings that hold only one of x2 and y2 are no longer read
as an editable flare; the group stays as art.
Docs: params text, docs/mcp.md, docs/target-app-parity.md.
Part of #1210.
- `cargo xtask corpus --scripts` fetches 397 scripts and 1 included file
from 19 MIT and Apache-2.0 repositories at pinned commits into
corpus/scripts, each repository's license file beside its scripts.
xtask/script-corpus.txt lists every file with its size and SHA-256; a
download replaces the previous copy only when both match. One more
candidate is listed as excluded because it is over the 1 MiB limit for
one script. The fetch caps 64 MiB of scripts and 128 MiB of transfer,
refuses `..`, absolute paths, reserved names, case-fold collisions and
links, and holds a lock file while it runs.
- `cargo xtask corpus` takes at most one of --download, --affinity and
--scripts, and refuses other arguments with the usage text.
- `cargo xtask scripts --pass-rate [--report <path>]` runs each script in
a process of its own (the ignored `row` test in
crates/engine/tests/script_corpus.rs): a new document, 5,000,000
instructions, no dialog answers, file reads only in the script's
repository folder and a new folder of its own, file writes only in that
folder, stopped after 10 seconds. It writes a JSON report with the pass
rate overall, per repository and for scripts without dialogs or
windows, how many parse, and each script's outcome, with local folders
removed from messages. Script failures never fail the command, and
without the corpus it prints a skip line and exits 0.
Pasted type whose custom set was edited after the copy is checked against
a fresh layout by its line ends, which move from A to B while the line
count stays the same, so the test fails without the relayout in Relink.
The every-line composer's first-word measure is checked in a frame whose
top is narrower than the word the custom set's Cannot End Line makes, so
the test fails when that measure uses the built-in setting instead.
A plain symbol instance does not expand on its own, so the Safe Mode
plug-in check skipped its symbol's art. When a group or layer around the
instance has a raster effect (its own, or on one of its fills or
strokes), the group's image draws that art, plug-in effect included, and
Expand Appearance committed pixels without the plug-in effect instead of
returning the Safe Mode error. The check now looks into every object of
such a group or layer, symbol art included.
A plain Lasso click away from the art deselects everything but kept the
mesh points the tool held, so the Mesh tool chosen next showed the
deselected points as picked, nudged them with the arrow keys and
recolored them with a fill color. The click now unpicks them. Shift and
Alt clicks still change nothing.
docs/target-app-parity.md also lists the Eyedropper among the tools that
keep the picks, and docs/mcp.md describes the Lasso click.
Test: a_lasso_click_that_deselects_unpicks_the_mesh_points in
crates/engine/src/tests/mesh_picks.rs.
symbol.place, symbol.placeFromDocument and symbol.addFromLibrary with
`place` now read the drawing mode: in Draw Behind the new instance goes
directly below the selected object, or at the bottom of the current
layer when nothing is selected, as the help page describes for placing
symbols
(https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/learn-drawing-basics/drawing-modes-overview.html).
Place Symbol Instance in the Symbols panel and a symbol dragged onto
the canvas from the Symbols panel or a symbol library all go through
these commands.
VectorCraft's own rules: with several objects selected the instance
goes below the bottommost one, a selected path in a compound path puts
it beside the compound path, and a clipping path stays at the bottom of
its clip group or clipping layer. Draw Normal and Draw Inside keep the
instance on top of the current layer, and a locked or hidden layer
still refuses it with no edit.
An image that keeps CMYK inks is stored as TIFF, and Unembed writes it as a .tif file when the path has no extension. The comment above the format choice now lists TIFF with PNG, JPEG, GIF and WebP.
graphicStyle.redefine passed the redefined style to every path directly in a
graph series group linked to it, and to every line and label of a linked Axes
or Legend group, so a member linked to another style (the `from` style or a
third one) was restyled and relinked to the target. Such a member now keeps
its look and its link, in the `from` and the object forms; unlinked members
and members still linked to the target follow as before. The group is still
cleared and unlinked, and one undo takes it all back.
Gradient mesh points picked with the Mesh tool, Direct Selection, the
Lasso or the Polygonal Lasso now stay picked when another of these tools
is chosen, and when one of them lends Direct Selection for a Cmd/Ctrl
click, so a fill color chosen afterwards recolors just those points.
Before, only a switch to or from the Eyedropper kept them. Any other
tool, Group Selection included, drops them.
Session::switch_tool, lend_selection_tool and give_back_tool share one
test of which tools pick mesh points. Giving the tool back leaves the
lender's picks alone when they did not change, so the Mesh tool keeps
the point whose handles it shows.
Tests: crates/engine/src/tests/mesh_picks.rs.
Docs: docs/mcp.md, docs/target-app-parity.md.