Commit Graph
89 Commits
Author SHA1 Message Date
dotCooCoo a82de18956 Symbols: in Draw Behind a placed instance goes directly below the selection
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.
2026-11-20 15:14:53 -08:00
bflatastic 850338909e Symbols: a recolored instance is noted without a nested if 2026-11-19 23:04:07 +07:00
bflatastic ba919a0ea0 Symbols: the step from the previous point reads it with get, so the adjust closure stays under the complexity limit 2026-11-19 23:03:34 +07:00
dotCooCoo b20c22500a Merge main into feat/symbolism-shift-gestures 2026-11-19 06:05:13 -08:00
dotCooCoo bae4defa45 Symbols: Average sizes are sizes on the page, and a pen pressure change where the pen stays is kept
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.
2026-11-18 17:34:48 -08:00
dotCooCoo 3ef0e5e588 Symbols: the Symbolism tools take their new options, and OK checks them before any change
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.
2026-11-18 15:10:38 -08:00
dotCooCoo 97a2b802a4 Symbolism: tool.setOption takes every Symbolism option, and OK checks ranges first
- 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.
2026-11-18 15:02:02 -08:00
dotCooCoo 3258e97f8e Merge main into feat/symbolism-options-method 2026-11-18 07:27:02 -08:00
dotCooCoo dc28614bd9 Merge main into feat/symbolism-shift-gestures 2026-11-18 07:27:02 -08:00
dotCooCoo 2fa55b2aeb Merge main into feat/symbols-panel-options-button 2026-11-17 22:24:17 -08:00
BFlat e49686185e Merge pull request #8465 from dotCooCoo/feat/scatter-brush-hue-jitter
Brushes: Scatter Brush Options has Hue Jitter, a per-copy hue turn
2026-11-18 13:15:11 +07:00
BFlat 0bba8a8666 Merge pull request #8423 from dotCooCoo/feat/symbols-redefine-shift-keeps-art
Symbols: Shift with Redefine Symbol keeps the art as ordinary art
2026-11-18 13:12:06 +07:00
BFlat d17d152620 Merge pull request #8386 from dotCooCoo/feat/symbols-alt-drag-redefine
Symbols: Alt-dragging art onto a symbol in the panel redefines it
2026-11-18 13:11:46 +07:00
BFlat 3a9bb87022 Merge pull request #7925 from dotCooCoo/feat/brush-options-of-selected-object
Brushes: Options of Selected Object changes one brushed path's brush settings without changing the brush
2026-11-18 10:18:41 +07:00
dotCooCoo fecf69fc58 Symbols: symbol.adjust collects instances in linear time
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.
2026-11-17 18:12:55 -08:00
dotCooCoo a0228dd460 Brushes: Scatter Brush Options has Hue Jitter, a per-copy hue turn
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.
2026-11-17 14:24:19 -08:00
dotCooCoo cc4ce97fc3 Symbols: Shift with New Symbol keeps the art as ordinary art
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.
2026-11-17 13:18:49 -08:00
dotCooCoo 3919a1a5df Symbols: Shift with Redefine Symbol keeps the art as ordinary art
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.
2026-11-17 11:51:44 -08:00
dotCooCoo 999e538fd6 Symbols: Alt-dragging art onto a symbol in the panel redefines it
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.
2026-11-17 10:36:06 -08:00
dotCooCoo 29f20f8533 Merge main into perf/brush-targets-dedup-set 2026-11-16 10:51:44 -08:00
dotCooCoo 7c1ff5e2ef Merge main into feat/symbolism-shift-gestures 2026-11-16 08:27:13 -08:00
dotCooCoo 013510fca9 Merge main into feat/symbolism-options-method 2026-11-16 08:25:10 -08:00
dotCooCoo 75b02ea8df Symbols: the panel reads the current symbol without running symbol.list
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.
2026-11-16 05:29:31 -08:00
dotCooCoo 3e57f8311c Brushes: brush_targets drops repeated paths with a set instead of a linear search of its output
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.
2026-11-16 03:04:09 -08:00
dotCooCoo a8abd874f2 Symbols: symbol.spray refuses a style that is not a name
A style parameter that is not a string was read as no style, and the
default style applied. It is now an error.
2026-11-15 23:46:09 -08:00
dotCooCoo 86694a1b30 Symbols: check dialog fields and the sprayed style before any change
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.
2026-11-15 23:28:21 -08:00
dotCooCoo b3c15f6e73 Symbols: refuse bad Symbolism Tools Options and find spacing with a k-d tree
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.
2026-11-15 22:51:30 -08:00
dotCooCoo 0e1592d76a Symbolism: the Symbol Styler applies the style by the brush's strength
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.
2026-11-15 21:55:27 -08:00
dotCooCoo 6d470d9878 Symbols: Average keeps opacities below the Screener's 5% minimum
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.
2026-11-15 21:48:14 -08:00
dotCooCoo 11942b04d6 Symbolism: Shift recolors a pattern stain, and the options dialog refuses bad values
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.
2026-11-15 21:36:36 -08:00
dotCooCoo 7d0aef8bc5 Merge main into feat/symbolism-options-method 2026-11-15 20:54:06 -08:00
dotCooCoo 1ff1a4c29c Merge main into feat/symbolism-shift-gestures 2026-11-15 20:06:17 -08:00
dotCooCoo be12c9ed36 Brushes: Options of Selected Object keeps a path's null modes and largest width, and its document
- 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.
2026-11-15 17:52:41 -08:00
dotCooCoo fd7bdee746 Merge main into feat/brush-options-of-selected-object 2026-11-15 16:35:36 -08:00
dotCooCoo 628bd5229c Brushes: Options of Selected Object keeps the mode each path draws with when a value changes
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.
2026-11-15 13:18:05 -08:00
dotCooCoo 3a84466917 Symbols: Symbol Options › Align to Pixel Grid keeps a symbol's instances on the pixel grid
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.
2026-11-15 12:25:35 -08:00
dotCooCoo 0bbddf5cc4 Symbols: Random styling and Symbol Set Density follow the brush and the set
- 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.
2026-11-15 11:35:08 -08:00
dotCooCoo b782cfbd9e Symbolism: the Symbol Styler applies the style picked in Graphic Styles
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.
2026-11-15 11:24:09 -08:00
dotCooCoo 87acb57d0d Brushes: Options of Selected Object keeps each path's values the dialog did not change
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.
2026-11-15 10:17:25 -08:00
dotCooCoo c883b808cc Symbolism: a bad pen pressure is refused on a point without coordinates
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.
2026-11-15 09:17:13 -08:00
dotCooCoo 5437bdeacd Merge main into feat/brush-options-of-selected-object 2026-11-15 09:07:51 -08:00
dotCooCoo 9590e0f35a Symbolism: copied sets keep their density, and the options dialog scrolls
- 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.
2026-11-15 08:56:27 -08:00
dotCooCoo 0daad87499 Brushes: Options of Selected Object changes one brushed path's brush settings without changing the brush
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.
2026-11-15 08:50:04 -08:00
dotCooCoo 1340719244 Symbols: a symbolism stroke counts only the instances it changes
- 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.
2026-11-15 07:31:20 -08:00
dotCooCoo 09b9c2e450 Merge main into feat/symbolism-options-method 2026-11-15 06:16:00 -08:00
dotCooCoo fdddb72c4b Merge main into feat/symbolism-shift-gestures 2026-11-15 06:14:27 -08:00
dotCooCoo dba9c8066d Symbols: Shift with the Symbol Stainer and Styler keeps the instance's other fills
The paint of the topmost fill changes in place, so its blend mode,
effects and the instance's other appearance items stay as they are.
2026-11-14 18:48:17 -08:00
dotCooCoo d601ec31ca Symbols: the Symbol Shifter, Sizer, Stainer and Styler take Shift
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.
2026-11-14 18:19:55 -08:00
dotCooCoo ba9acf808e Brushes: brush.freehand is one undo step and refuses strokeless paths and unknown keys
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".
2026-11-14 17:31:16 -08:00
dotCooCoo cb1796185e Symbols: Symbolism Tools Options gain Method, pen pressure and the Sprayer and Sizer options
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.
2026-11-14 14:15:18 -08:00