The Blend panel, the Object › Blend, Envelope Distort and Gradient Mesh
menu items and their commands looked up every ancestor of each selected
object by id to find its nearest blend, envelope or mesh, and dropped
repeats with a linear scan. They now read the object's cached place in
the tree once, test the nodes on that path, and keep a set of the ones
already listed. The checks of whether one is selected stop at the first
selected object that has one. An id that the lookup cache does not
place on that path (a repeated id, or a cache older than the tree) is
still looked up by id, so the results, their order and the errors are
the same. Explicit ids given to the live commands drop nested ones with
a set as well.
With Select All of 102,200 objects (100,000 rectangles, 2,000 blends and
200 envelopes), a release build took a median of 16.5 ms of thread CPU
time for the Blend check before and 0.5 ms after.
Each round of the repeated hit test that Select Behind uses in isolation
mode and in Edit Contents skipped the objects already found by searching
the found list, which made one Cmd/Ctrl-click cubic in the number of
objects under the point. A set beside the ordered list answers the same
lookups, so the objects and their order do not change.
A test compares the set lookup with the list lookup on random documents
for every object isolated in turn, and an ignored timing test measures
both on 200 and 1,000 stacked objects.
After an edit of a document with symbols, the refresh of inline graphics
walked every node of every layer. It now keeps the document the last
refresh left resolved, with the symbol bounds it measured, and checks
only the layer trees that are not the same nodes as that document's,
as long as the symbols, graph designs, pattern tiles and foreign data
(which holds the symbols' natural sizes and 9-slice guides) are the
same and each measured symbol still measures the same. Otherwise the
full pass runs, as before. Visit order is unchanged, so the document
and the ids of the texts laid out again equal the full pass's.
A line drawn with the Line Segment tool now shows Line Properties in the
Transform panel and the Properties panel's Transform section, with the two
properties the help page lists for a line:
https://helpx.adobe.com/illustrator/desktop/draw-shapes-and-paths/modify-live-shapes/live-shape-properties.html
- object.setLiveShape takes lineLength (pt, above 0) and lineAngle
(degrees, brought into 0 to 360). Every selected line changes in one
undo step; a value that changes nothing records none.
- VectorCraft's own rules: the angle runs counterclockwise from 3 o'clock,
as the Rotate field does; a new length keeps the first end in place and
a new angle turns the line about its midpoint; a line whose ends meet
reads 0 degrees; the section shows only while every selected object is a
live line; a line that would reach past the coordinate limit is an error
that changes no line.
Docs: docs/mcp.md, docs/target-app-parity.md.
Add Used Colors and New Color Group link the selected art's paints to
global swatches through Document::map_solid_paints_in, which drops each
id that sits inside another listed id. It searched the whole id list for
each ancestor of each id, so the work grew with the square of the
selection. It now looks each ancestor up in a set of the ids, as
without_inner in crates/engine/src/cmd/edit.rs does. The roots keep the
order of the list, duplicates and ids missing from the document, so the
same paints are linked in the same order.
- mapping_within_ids_matches_a_search_of_the_ids compares the count, the
paints visited and the resulting document with the search for every
list of up to three ids from a nested tree (nested ids in both orders,
duplicates, a missing id and an empty list).
- crates/engine/examples/link_colors_bench.rs times both ways in one
process. With 20,000 selected rectangles the call takes 16 ms of CPU
time instead of 128 ms; with 2,000 it takes 1.4 ms instead of 2.5 ms.
The drawn-art store that main added for clicks now keeps its entries as
the shared Evaluated type, so a kept entry is also measured again when a
symbol's 9-slice guides or natural size change. Evaluated::new builds an
entry for both stores.
Type on a path sits at fractions of its path's length. Scaling the path
non-uniformly changes where a fraction lands (CodeRabbit's case: M0 0 L100 0
L100 100 under diag(2, 1) moves the start bracket from (200, 0) to (150, 0)).
Path type now bakes the vertical scale into the character sizes and scales
its path uniformly by it, which keeps every fraction where it was; the
horizontal stretch stays in the transform.
Baking an object's scale into the character attributes removed that scale
from the type's transform, but the area frame (and a path type's path), which
is drawn through that transform too, kept its unscaled size. A 120 x 80 frame
scaled 200% shrank back to 120 x 80 on the page, so the 24 pt type broke into
two lines and the rest became overset.
The frame and the path now take the scale the transform loses, so they, the
line breaks and every glyph stay where they were.
Fixes#8297
- The steps of a live blend are written as drawn art: copies of key
objects with text wrap options no longer write those options again.
The keys keep theirs on the hidden lines and the blend keeps its own.
- The record holds Specified Distance as a 32-bit float, which the
reader reads back as its shortest decimal. The writer now compares the
blend with that distance, so a distance typed in another unit (10 mm
is 28.346456... pt) is written live when it lays out as many steps.
- blend_steps_settled has unit tests for each of its cases.
- blends_write_the_same_bytes_again checks that every blend is written
live both times.
- Comments name the blend plugin's XP line by its constant.
- docs/target-app-parity.md lists live blends in the .ai editing copy;
a line in docs/file-format-parity.md is wrapped like the rest.
Tests: a_live_blends_steps_carry_no_text_wrap_options,
a_blend_spaced_in_millimeters_is_written_live,
steps_settle_unless_rounding_can_change_their_count.
The editing copy of a PDF-compatible .ai wrote every blend as its steps.
Blends the .ai reader opens live are now written live:
- The blend's key objects and, when it has a spine of its own, its
spine are written as a group on hidden lines, each key's dictionary
naming it a key and its id and the spine's naming it the spine. Its
steps follow as a group, then the Path Blends record of its spacing
(Smooth Color, Specified Steps, Specified Distance with its distance),
orientation (Align to Page, Align to Path) and keys, then its
dictionary (name, text wrap options, variables) and its opacity and
blending mode as a group's after its end. A spine edited on the canvas
is written with each key's anchor on the key. A replaced spine is
written with an anchor where each key sits, so it opens with those
anchors and lays out the same steps.
- Each blend is checked with the reader's own reading before it is
written, and the blends together against the objects the reader lays
out in one file. Written as their steps with a warning: blends with
easing, a color shift or start points; with effects, an appearance or
an opacity mask of their own; of objects other than paths, compound
paths and groups, of clipping groups, of more than 62 key objects, of
hidden keys or keys holding a blend; of keys with geometry or
Pathfinder effects or a group's own fills and strokes, which the
editing copy writes as their result; of keys the editing copy would
change otherwise (empty paths or subpaths, paths and compound path
members of several subpaths, several fills or strokes, strokes a plain
line can't draw, dashes of more than 64 lengths, hidden fills or strokes, fills or strokes other than
a color, in a Lab color or with transparency or effects of their own,
effects, opacity masks); blends where one key has a fill or stroke of
no paint or a stroke of no width and another has one that draws;
blends whose spine has more than one part;
blends whose step count is close to where rounding the written
coordinates and colors changes it; blends the reader would open with
other settings or not as drawn; blends inside objects with geometry or
Pathfinder effects or a group's own fills and strokes; blends in
opacity masks, pattern tiles, symbols and art cut to a clipping object
or nested eight levels deep in art written in place of other objects;
blends whose art would pass the most objects the reader reads; and
every blend on a large canvas.
- The steps set their own transparency and lock and hidden state after
the hidden lines, for readers of the printed form.
Each construct is written in the form the .ai reader reads (blend.rs,
read/document.rs blend roles, read/containers.rs end_blend, read/ops.rs
XP and transparency), and every object written counts toward the
reader's object limit as the reader counts it. The record's orientation
word and a blend with no spine part are read as #8243 reads them.
Blend Options, key objects and spines:
https://helpx.adobe.com/illustrator/desktop/manage-colors/apply-transparency-and-blending/blend-options-overview.htmlhttps://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=260
Tests: the round trip of blends of each spacing and orientation, with
no spine of their own, an edited spine and replaced curved spines,
named, at half opacity, hidden and locked, with text wrap options, of
compound paths, of groups and of 62 keys, each laying out the same steps
as the document's blend; the record's words (Align to Path's angle
included) and the dictionaries; the steps' own state after the hidden
lines; the same bytes on a second write; each case written as its
steps, with as many steps as are drawn, where they are drawn (among
them Specified Distance 0.03 pt from where its count changes, on a
spine of 200 segments, which comes back live on a spine of two); blends in
pattern tiles, opacity masks, symbols, art cut to a clipping object and
eight levels down; the object limit; the reader's blend limit; a large
canvas; fuzz cases for damaged written blends.
Docs: docs/file-format-parity.md.
EPS export writes a gradient whose stop links to a spot swatch named
Cyan, Magenta, Yellow or Black and carries process plates in process
colors, with a warning. The stop_inks doc comment and the progress-doc
line now say so.
A fill, stroke or gradient stop links to a swatch by name, and the first
swatch of that name is the one it prints from. The plate list added a spot
plate for every spot swatch, so a spot swatch after a process swatch of the
same name got a plate that printed nothing, while art linked by that name
separated as process. The plate list now takes only the first swatch of
each name.
A spot swatch named Cyan, Magenta, Yellow or Black had no plate of its own
and printed nothing on the process plate of its name. Art linked to it now
prints its tint on that process plate, as PDF and EPS export write it, and
a gradient stop's own process plates print beside it.
- A gradient's freeform points count only when its kind is Freeform, in
the Overprint Black check and in the plate separator. A gradient of
another kind is checked by its stops.
- Characters inside opacity mask art no longer draw with Darken on
separations, as the mask art's fills and strokes already do not.
- With Overprint Black on, a symbol instance whose own fill or stroke
changes or fill stain repaint its art, or whose symbol holds such an
instance, prints as its placed art and is checked with the paints it
prints with. Placement stays within the symbol object limit and the
drawn depth limit, and skips hidden objects and template layers.
The export walks for type and fonts and the artboard crop shared one
SymbolBoxes for every object. A SymbolBoxes also holds measuring budgets
(effect reaches, 9-slice placements), so in a large document objects late
in a walk could be measured by estimates where main measured them exactly.
SymbolBoxes::unmeasured makes new boxes that share the name index, and each
object is measured in boxes of its own again.
- The live-object walk (render/src/live.rs) finds symbols through the
frame's SymbolBoxes.
- SVG export's filter regions measure each object in unmeasured boxes, and
the region boxes share the writer's index.
- SVG import keeps each imported symbol's index, so a symbol whose art
holds instances no longer scans or indexes the list again.
- Object › Rasterize's clipping mask is left as it is on main, with
drawn_outline_with removed.
- The symbol-read-count feature of vectorcraft-doc gives other crates'
tests vectorcraft_doc::symbols_read. New tests check that a frame, an SVG
export, a PDF export, the type walk and the artboard crop read the symbol
list once among 2,000 symbols and 300 instances with drop shadows.