With repeated names numbered when a brush library is read, a stroke that
names a repeated brush draws the first brush of that name, and a later
brush of the name is read as "Name 2". Three tests built a library with a
repeated name and expected the later brush:
- Document Info lists a name two stored brushes share with the first
brush's type (art), not the last one's.
- The two render memory tests add their own `Dots` scatter brush beside
the default library's `Dots`. They now remove the default `Dots` first,
so the stroke draws their brush.
- The .ai writer test that leaves out a Pattern brush "X" gets the
Calligraphic brush after it back as "X 2", the name it had in the
document.
With the selection as its scope, a fix that removes or unwraps objects
(Needless Groups, Stray Points, Empty Text and the others) kept the list
of selected objects current by searching it and splicing it once for each
object it changed. Removing many selected objects above a long run of
others took time that grew with the square of their number.
The list is now rebuilt in one walk after each pass: each changed object
gives way to what replaces it, in its place, and the others keep their
order. The objects found, the counts, the document and the undo step are
the same as before.
Empty Artboards deleted each empty artboard with its own Vec::remove and
walked every ruler guide again for each one. It now drops the empty
artboards in one walk and deletes their guides in one more. The same
artboards and guides are deleted as before.
Tests cover the order after unwrapping nested and empty groups, Fix All
reaching an unwrapped member on a later round, the rebuild itself, the
number of objects looked at for 150 and 300 removals, and the number of
walks over the artboards and guides when 40 empty artboards are deleted.
A Smooth drag along the middle of a curved segment smoothed nothing when
neither of the segment's anchors was within the reach, and paths of two
anchors were never smoothed.
- path.smoothRegion searches each curved segment where it can come
within the reach, halving it down to pieces no longer than half the
reach, and adds an anchor in the middle of each stretch in reach; the
existing reach split then cuts the segment where the drag enters and
leaves the reach. A drag that only grazes a curve finds the place on
it nearest the drag. The search is bounded per drag and shared
equally by the segments in reach.
- Paths of two anchors are smoothed, open or closed.
- Alt with the Paintbrush smooths a selected two-anchor curve; a
two-anchor straight line still gets the closed stroke. Both sides use
one segment_is_straight test.
Part of #2224
While the Smooth tool drags with a path selected that it can smooth, a
dashed outline shows the band its release smooths: every point within
the tool's radius (12 screen pixels) of the drag, round at both ends.
Alt smoothing with the Pencil, Paintbrush and Blob Brush shows the same
band. A selection with no path the tool can change shows none.
- The band is kept in squares eight radii wide, and each step of the
drag adds its area only to the squares it reaches. A piece of a
square's outline along a side is left out only where the square
across holds band area.
- A drag segment too long for the squares (a jump drawn zoomed out and
viewed zoomed in) keeps its band near each end in the squares and
shows the rest as the two sides of its band. A step that cannot be
added whole is added one segment at a time.
- A coarser grid of cells lists the squares and long segments, so a new
one is checked only against those near it, and an outline is made
again only where the band near it changed.
- After a zoom change mid-drag the band is outlined again a few hundred
points per frame, and the work on long segments stops for the frame
after a fixed budget. Tools report unfinished overlays with
Tool::overlays_pending, and the canvas then draws again on the next
frame, so the band covers the whole drag even while the pointer holds
still.
In SVG and PDF output, each piece of a warped image whose pieces can show
through was drawn through a mask of every later piece that reaches it. On a
later piece's antialiased edge the viewer multiplies the earlier piece's
coverage by the mask and draws the later piece over it, so an image with
both opaque and partly transparent pixels came out lighter at its opaque
pixels along the triangles' edges (alpha 184 of 255 in the new SVG test).
A later piece now goes into an earlier piece's mask only when a pixel of
either piece's image within 2 pixels of their overlap is less than opaque
(vectorcraft_effects::WarpSeams). Where two pieces overlap over opaque
pixels, the later one is drawn over the earlier one without a mask.
Type with an inline graphic was resolved only in the layers, so type in
the art of another symbol, a graph design, a pattern tile or an opacity
mask kept the size its graphic had when it was made. The symbol holding
that type, its instances and the inline graphics that show it were
measured from the stale layout.
- Inline graphics are resolved in every tree that holds type. Symbols
are resolved in dependency order, so a symbol's type is laid out
before the type that shows that symbol inline. Edits, opening,
reverting and Refresh Font List use the same pass.
- The pass visits each object once: it resolves the children first and
copies a node only when something below it changed. It measures each
symbol's art once per pass.
- An inline graphic of a symbol whose art shows that symbol inline,
directly or through other symbols, is an empty slot. The symbols on
such a cycle are found once and cached until the symbols change.
- A changed inline graphic also clears the text's cached baselines.
Brushes, Spot Color Objects, Pattern Objects and Gradient Objects left
out a fill or stroke that was hidden or at an opacity of 0, but still
listed an object that was itself hidden or at an opacity of 0, and the
objects inside such a group or layer. They now leave those out, their
characters' paints and colorized images included. With Selection Only,
an object selected inside a hidden group or layer, or one at an
opacity of 0, is left out too. Objects still counts every object.
Edit > Edit Colors > Convert to Indexed Color... (edit.colors.toIndexed)
stores the embedded images in the selection as indexed-color PNGs: a
palette of at most 256 RGB colors, each pixel the index of one. The
dialog previews live and OK is one undo step.
- The palette is chosen as for a PNG-8 export (selective, perceptual,
adaptive, web, gray, black and white), as evenly spaced levels of red,
green and blue (uniform), or from the document's swatches. Dithering
is diffusion, pattern, noise or none, with an amount.
- Pixels under half opacity become one transparent entry; the others
become opaque in their own color. Linked images, colorized images and
color glyph images keep their pixels.
- An image that is already an indexed PNG and would show the same pixels
is left as it is, and no undo step is recorded when no image changes.
- An image of more than 134,217,728 pixels (33,554,432 in the web app)
is refused, read from its header before decoding.
- With Select All, locked and hidden objects that hold an image that is
not an indexed PNG yet are counted in notChanged, without converting
them.
- The quantizer gains quantize_to, which maps pixels to a given palette.
Docs: docs/mcp.md, docs/target-app-parity.md.
file.newProfiles.edit and file.newProfiles.reset returned the automation
access check and file system errors with the profile file's whole path,
so a client confined to read roots that leave out the preferences folder
learned where the folder is. The errors now go through naming_in_error,
like other paths the client did not give: whole inside the read roots,
otherwise by file name. docs/mcp.md and the params text say so.
A document or brush library file could hold two brushes of one name.
Renaming the first in Brush Options moved every stroke of that name and
left the second brush unreachable, deleting by name removed both, and
the Brushes panel could not select the second row.
Reading a stored brush library now keeps the first brush of a name as
stored and numbers each later one with the first "Name 2", "Name 3" and
so on that the file does not already have. Strokes name their brush,
and a name always found the first brush, so every stroke keeps drawing
the brush it drew before. The rule applies to opened documents and to
brush library files; brushes added to a document that already has the
name keep today's numbering.
Docs: docs/mcp.md, docs/target-app-parity.md.
An envelope around type of only spaces and a rectangle mapped from the
union of the rectangle and the type's laid-out box, so the empty type
moved and scaled how the rectangle was distorted. Type that draws
nothing now adds no box while other content in the envelope has one,
in groups and layers and as a clipping path too. When nothing else in
the envelope has a box, the type keeps its laid-out box, so an envelope
of only empty type keeps its frame, Make with Mesh and Reset with Mesh
still work, and Release still gives back the warp shape.
This applies to Make with Warp, Make with Mesh, Make with Top Object,
Reset with Mesh, Edit Contents and the stroke margins. Type that has
not been measured yet keeps its laid-out box as before.
The PDF/.ai import's boxes for envelopes with Distort Appearance
measure each object as the whole contents measure it, so the margins
the import tries match the contents' geometric box. The three import
tests that measure type without registering the glyph measure now
register it first, so another test registering it while they run no
longer changes their result.