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.
The Sizer's and the Sprayer's Average compare each instance's size on the page, so a set that
holds instances of different symbols meets at their mean drawn size. A symbol without a recorded
size is measured by its art, once per command. With Size: Average and no instance under the brush,
a sprayed instance has its symbol's own size whatever `scale` is, and new instances are spaced by
the size they are placed at. With Use Pressure Pen, a drag sample at the same position is kept when
the pressure changes by 0.05 or more.
tool.setOption now accepts usePressure, method, showBrush, the Symbol
Sprayer options, proportional and affectsDensity for the Symbolism
tools, so the Symbolism Tools Options dialog can save them. The dialog
checks every option, the number ranges included, before
symbol.setDensity re-spaces the selected symbol sets.
- Size: Average gives a sprayed instance the mean size under the brush,
or the symbol's own size with none there, without the size jitter.
- A stroke that moves an instance away and back again does not count
it, and adds no undo step.
- symbol.adjust reads an instance's own values for Average only.
- The Symbolism tools' check_option accepts usePressure, method,
showBrush, the six Sprayer options, proportional and affectsDensity,
so tool.setOption and the options dialog's OK save them.
- OK runs both of tool.setOption's checks, ranges included, before
symbol.setDensity, so a refused diameter leaves the sets' density.
- Average skips a stain or style at opacity 0: the Sprayer's mean and
the Stainer and Styler take the visible one's paint.
- symbol.adjust reads an instance's look only for Average and the Shift
recolor, so the Shifter moves an instance whose transform flattens it.
- restack collects the parents in a BTreeSet.
- The symbol.spray, symbol.setDensity and symbol.adjust texts and
docs/mcp.md describe the size base and jitter, the third point value,
the starting density, the Random and Alt Styler, and density errors.
symbol.adjust checked each symbol instance in the selection against
every instance it had already collected, so I instances cost about
I^2/2 comparisons on every call, and the symbolism tools call it on
every drag frame. It now keeps a HashSet of the ids it has pushed. The
list is unchanged: the same ids in the same walk order, each kept where
it is first reached.
A unit test checks the result for nested groups, a group listed twice
and members listed before and after their group, and compares it with
a copy of the old collector.
A scatter brush takes a Hue Jitter amount from 0 to 180 degrees (0 by
default). Each copy turns the hue of its solid fills and strokes, type
included, by its own amount up to that far either way, after the
colorization. The amounts come from the stroke's path and the brush
name, so a stroke draws the same colors on every redraw, after Save and
Open, and in export. Copies keep their places, sizes and rotations.
A color turns in its own model (RGB in the HSB of its values, CMYK over
C, M and Y with K kept, Lab by turning a and b). White, black and grays
stay as they are, and a symbol instance in the art turns only its stain.
A brush at 0 draws its copies in the colors the colorization gives them
and saves no hue_jitter key; a brush without the key reads as 0.
- brush.options takes hue_jitter, and brush.get shows it for every
scatter brush. Brush Options shows a Hue Jitter field (ui.brushOptions
field hueJitter) with rows in every catalog.
- The .ai editing data writer does not write the amount, so a jittered
brush is left out of the Brushes panel there and reported, as other
brushes that would open with other settings are.
Docs: docs/mcp.md, docs/target-app-parity.md.
Making a new symbol from the selected art with Shift held now adds the
symbol and leaves the art as ordinary art, as the Create a symbol section
of the help page describes
(https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=192).
Without Shift the art still becomes an instance.
- symbol.new takes keepArt (default false). With true the art keeps its
ids, layer and stacking position and stays selected, apart from art
that cannot be selected, frames of threaded text stay in their
thread, and the result's id is null. A keepArt that is not true or
false is an error.
- The Symbols panel's New Symbol button and its New Symbol... menu item
read Shift when clicked and carry it through Symbol Options' OK;
Shift with Alt on the button makes the symbol at once and keeps the
art. Art dragged onto the panel reads Shift as it is released.
- ui.symbolOptions takes keepArt for a new symbol and refuses it when
editing a symbol.
Docs: docs/mcp.md, docs/target-app-parity.md.
Redefine Symbol chosen from the Symbols panel menu with Shift held now
updates the symbol and its instances from the selected art and leaves
that art as ordinary art, as the Edit symbols help page describes
(https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/edit-symbols.html).
Without Shift the art still becomes an instance.
- symbol.update takes keepArt (default false). With true the art keeps
its ids, layer and stacking position and stays selected, apart from
art that is hidden or locked, and the result's id is null. A keepArt
that is not true or false is an error.
- Redefining the symbol being edited with keepArt still leaves symbol
editing mode in the same undo step.
Docs: docs/mcp.md, docs/target-app-parity.md.
Art dragged off the canvas and released on a symbol's tile or row in the
Symbols panel with Alt (Option on macOS) held now runs Redefine Symbol
(symbol.update) for that symbol, in thumbnail view and both list views.
The symbol under the pointer is outlined while the art is held over it
with Alt. A drop without Alt still makes a new symbol.
- A canvas art drag records the document it came from; art of another
document, objects the document no longer has and an empty drag are
not taken.
- symbol.update refuses art that holds an instance of the symbol it
redefines, directly, in an opacity mask or through the art of the
symbols it nests, so neither the menu nor the drop can make a symbol
hold itself. The symbol-editing check shares the walk and now also
looks inside opacity masks.
- Panel art drops take only a release of the primary button.
Docs: docs/mcp.md, docs/target-app-parity.md.
The Symbols panel and its panel menu asked for the current symbol on
every frame by running symbol.list, which builds a row per symbol and
walks the whole document once per symbol to count its instances. They
now read it from the active document with cmd::current_symbol, the
rule symbol.list itself uses for its `current`: the stored name while
a symbol has it, else the first symbol. symbol.sortByName,
symbol.place, symbol.options and text.insertInline use the same
function, and symbol.list's reply is unchanged.
An idle frame of the panel or its menu now runs no command, so on
macOS the native menu is not brought up to date on every frame while
the panel is open. In a document with 200 symbols and 50,000 objects
the read takes 0.035 us instead of 48.5 ms in a release build (thread
CPU time on Linux, median of 7 runs). The gain matters on large
documents; on small ones it is too small to notice.
brush_targets checked each brushable node against every target it had
already collected, so P targets cost about P^2/2 comparisons. It now
keeps a HashSet of the ids it has pushed. The output vector is unchanged:
the same ids in the same walk order, each kept where it is first reached.
brush.apply, brush.remove, Expand on brushed paths and the brush library's
apply all collect their targets through it.
A unit test checks the exact result for guides, clipping paths, compound
members, nested compounds, repeated and overlapping roots and a missing
id, and compares it with a copy of the old collector.
The Symbolism Tools Options dialog refuses a tool that is not a
Symbolism tool and a number field that does not read as a number
before it gives the selected symbol sets a new density, so a refused
OK leaves the document as it was. A length with its unit is still a
diameter.
symbol.spray with Style: User Defined refuses a style the document
does not have. The Symbol Sprayer leaves out a style that has been
deleted, so the default style applies.
tool.setOption for a Symbolism tool now refuses a method or Symbol
Sprayer value outside its lists, and a usePressure, showBrush,
proportional or affectsDensity that is not true or false, and sets
none of the values. The Symbolism Tools Options dialog checks the same
values before it gives the selected symbol sets a new density.
Scrunch: Average measured each instance's nearest neighbor by scanning
the grid cell around it, which compared every pair when many instances
shared a cell. A k-d tree of the instances under the brush now finds
each one's nearest neighbor.
Without Shift, the Symbol Styler gave each instance under the brush the
style in full (and Random a fixed share of it), whatever the intensity,
the pen pressure or the instance's distance from the brush's center. It
now applies the style gradually, as it does the stain: by the brush's
strength at the instance, in full only at the center at intensity 10 or
full pressure. Random gives each instance its share of that amount.
The Symbol Screener with Method Average, and the Symbol Sprayer with
Screen: Average, clamped the averaged opacity to the Screener's 5%
minimum. A new instance sprayed beside invisible ones became visible,
and instances below 5% were raised instead of moving toward their mean.
Averages now stay within 0..1; the non-average Screener still stops at
5%.
docs/mcp.md also states that the User Defined Styler applies the whole
style whatever the intensity or pen pressure.
With Shift, the Symbol Stainer and the Symbol Styler move an instance's
stain or style toward the new paint. A pair with no form in between, such
as a solid color and a pattern, only switched at half strength, so strokes
below that never changed it. Such a paint now takes the new one at once,
keeping its amount.
OK in Symbolism Tools Options read a checkbox stored as a value other than
true or false as false, and a number stored as text that is no number as
0, so the check passed and the density could change. Each value now goes
to the check as it is stored, and a value of the wrong kind is refused
with no density change.
- A calligraphic path's `modes: null` (modes that follow its values) stays
when another value changes, instead of falling back to the brush's modes.
- An art `width` without a `width_max` keeps the largest width of each path
whose width follows the pen, so editing Width no longer moves the other end.
- OK changes nothing when another document has become the active one since
the dialog opened, as Delete Brush does.
A path without modes of its own takes them from its values, so a changed calligraphic variation or scatter range could change the mode the dialog showed (a Random size became Fixed when its two ends met). brush.objectOptions now keeps each path's drawn mode for every item params does not set, and still sets the modes params give.
The params text also says which way the calligraphic angle and the scatter rotation turn, as every_turn_param_says_which_way_it_turns requires.
symbol.new and symbol.options take alignToPixelGrid (off by default),
symbol.list rows report it, and the New Symbol and Symbol Options dialogs
show the checkbox. When it is on, the horizontal and vertical straight
segments of the paths in the symbol's art, opacity mask art included,
snap to whole points (half points for an odd centered stroke) at the
symbol's natural size, and its stroke weights become whole points. Each
instance placed at that size, reflected across one axis or not, moves to
whole points and goes back to them after every move. A scaled, rotated or
sheared instance, and an instance in another symbol's art, stays where it
is. In symbol editing mode the stored art and the editing layer snap
after each edit.
Duplicate Symbol, rename, copy and paste and symbol libraries keep the
setting, and Delete Symbol removes it.
Docs: docs/mcp.md, docs/ui-parity.md.
- With Method Random the Symbol Styler scales each instance's share of
the style by the brush strength, so the brush edge and a light pen
pressure style an instance less.
- symbol.setDensity gives every selected set the new density, also a set
whose instances do not move (one instance, or each locked), so a later
change packs it from that density. No undo step is added when every set
already has it.
A click that puts a style into the Graphic Styles panel's selection now
sets it as the Symbol Styler's style, and the Styler keeps it when
another tool is active. A style name the document has no style for (one
picked in another document, renamed or deleted) moves instances toward
the document's first style after the default one, as no name does,
instead of toward the current fill.
With several brushed paths selected, editing one end of a range in the
dialog sent the whole range, so every path took the first path's other
end. The dialog now sends only the items and colorization fields that
changed, and brush.objectOptions reads a null item of an array as each
path's own item, else the brush's. A null mode keeps the mode the path
has with its other values, and modes that change nothing are not stored.
symbol.adjust and symbol.spray skip a point whose x or y is not a
number, and the pressure check came after that skip, so a stroke with a
point such as [null, 0, "bad"] beside a valid one was applied. The
pressure is now checked first, and the command fails with the bad-pressure
error and leaves the document as it was.
- A symbol set duplicated in the same document gets the Symbol Set
Density recorded for its source, and a pasted set gets the density
recorded for it at Copy (also after Cut, after the source changed, and
in another document), so symbol.setDensity spaces the copy from that
density. A set with no record at Copy pastes with none.
Document::reid copies the record only when the source is the
document's own node with that id; the clipboard carries the records.
- symbol.adjust counts only the instances it changed: an instance the
brush reached but left as it was (the Symbol Screener at a limit) is
not counted, and a stroke that changes none adds no undo step.
- Method Average gives the Symbol Sprayer's new instance and the Symbol
Screener's instances the mean opacity also when it is below 5%.
- With Use Pressure Pen, a pressure change of 0.05 or more within a step
of the last point gives that point the new pressure. Once a drag has
its most points, a change away from the last point is not kept, and
a pressure change on a long stroke waits for the next preview or the
release instead of sending the whole stroke again.
- The Symbolism Tools Options rows scroll, so OK and Cancel stay in view
in a short window.
The Brushes panel menu gains Options of Selected Object…. It opens the
brush type's options dialog for the selected brushed paths, without the
Name row, and OK stores the changed values on those paths' strokes only.
The brush and its other strokes keep their settings.
- brush.objectOptions {ids?, params?, reset?} sets the settings, clears
them with reset, and returns them when given neither. It refuses
params with reset, a selection with no brushed path, brushes of
different types, a bristle brush, a field the type does not take and
a value of the wrong kind. One undo step, none when nothing changes.
- The stroke saves the settings as brush_options in the native file, and
the brush renderer, the expansion of pattern tiles whose brushes vary
at random and color conversion of Hue Shift keys read them.
- Applying another brush, removing the brush or a brush change carried
by Global Edit clears them; renaming the brush keeps them.
- Docs: docs/mcp.md, docs/ui-parity.md; i18n rows for the new strings.
- The Symbol Sprayer uses neither Intensity nor pen pressure: the dialog
disables both for it, and its brush overlay draws no intensity ring.
- symbol.adjust counts an instance only when it changes, so a Random
stroke that gives an instance no share, or a stroke at the tool's
limit, adds no count and no undo step.
- Average leaves an instance without a size (a scale of 0) as it is; the
other methods shift, scrunch, spin, stain, screen and style it as
before.
- Params text and docs/mcp.md say which values are refused: a point's
third number that isn't a number (in symbol.spray too), and a `from`
or `to` of symbol.setDensity outside 1..10.
- The 11 new dialog and command labels get rows in all 28 catalogs.
A Shift-click with the Symbol Shifter brings the symbol instances under
the brush one place forward in the stacking order, and Alt+Shift-click
sends them one place backward, without moving them on the canvas. The
Symbol Sizer with Shift keeps each instance's center, so the set's
density stays as it was, even with Resizing Affects Density. The Symbol
Stainer and the Symbol Styler with Shift keep the amount of an
instance's stain or style and move its color toward the fill color or
the selected style; an instance without one is left as it is.
symbol.adjust takes shift. No undo step is added when nothing moves or
changes, and a shift that is not true or false is an error.
brush.freehand drew the path with one edit and set the brush with a
second, so one Undo left the path without its brush. The brush is now
set in the same edit that draws, continues or redraws the path, and the
step is named Paintbrush whatever the style.
A brush for a path with no stroke (a continued or redrawn path without
one, or a new filled "pencil" path while the stroke is None) was skipped
and the call still succeeded. It is now refused with "cannot apply brush
`<name>`: path has no stroke" before anything changes. The Paintbrush
tool sends brush.freehand when a brush is current, so continuing or
redrawing such a path with it now shows this error. This rule is
VectorCraft's own.
brush.freehand is no longer in UNCHECKED: it takes the path.freehand
keys and `brush`, and any other key is refused with "unknown parameter".
The Symbolism Tools Options dialog adds Use Pressure Pen, Method (User
Defined, Average, Random) for the Scruncher, Sizer, Spinner, Stainer,
Screener and Styler, Show Brush Size and Intensity, the Symbol Sprayer's
Scrunch, Size, Spin, Screen, Stain and Style (each Average or User
Defined), and the Symbol Sizer's Proportional Resizing and Resizing
Affects Density. A Tool row switches which tool's options show.
symbol.adjust takes method, usePressure with [x, y, pressure] points,
proportional and affectsDensity; symbol.spray takes attributes. The new
symbol.setDensity gives the selected symbol sets a new Symbol Set
Density, from the density each set was created at or last given, as one
undo step. A symbolism stroke that changes no instance adds no undo
step.