mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-23 10:53:35 +01:00
Merge pull request #8732 from storytold/train/carry7739
Symbols: the Symbol Shifter, Sizer, Stainer and Styler take Shift (#7739)
This commit is contained in:
17 files changed
+1012
-70
No files matched your search
+35
-8
@@ -3892,23 +3892,34 @@ already walks Image Trace. Short agent entry points:
|
||||
[the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)):
|
||||
`symbol.adjust` takes `method` (`userDefined`, `average` or `random`; not used by `shift`), `usePressure` with
|
||||
`points` as `[x, y, pressure]` (each point's pen pressure, 0..1, is the intensity there), and for `size`
|
||||
`proportional` (true) and `affectsDensity` (false). `symbol.spray` takes `attributes`
|
||||
`proportional` (true) and `affectsDensity` (false). With `tool: style`, the style goes on by the brush's strength at
|
||||
each instance: one sample applies it in full only at the brush's center at intensity 10 or full pressure, and the
|
||||
samples of a stroke add up (two samples at the center at intensity 5 apply it in full). With `alt`, `userDefined`
|
||||
and `random` remove all of an instance's appearance items under the brush at once, whatever the brush's strength.
|
||||
A `style` name the document
|
||||
has no graphic style for counts as none (the document's first style after the default one). The Symbol Styler and the
|
||||
Symbol Sprayer (its User Defined Style) send the style last clicked into the Graphic Styles panel's selection. `tool.setOption` on a symbolism tool refuses a `method` or
|
||||
Symbol Sprayer option that is not one of its names, a non-number `diameter`, `intensity` or `density`, a
|
||||
`diameter` outside 2..2000 or an `intensity` or `density` outside 1..10, a non-boolean switch, and a `symbol` or
|
||||
`style` that is neither a name nor null, and sets none of the values. The options dialog's OK checks the same way
|
||||
before it changes any symbol set's density.
|
||||
`symbol.spray` takes `attributes`
|
||||
`{scrunch?, size?, spin?, screen?, stain?, style?}`, each `average` or `userDefined`, with `color`, `keepModel` and
|
||||
`style` for the User Defined stain and style (with `style: userDefined`, a `style` the document does not have is an
|
||||
error). `symbol.setDensity {from, to, ids?|id?}` gives the selected symbol
|
||||
sets a new Symbol Set Density. VectorCraft's own rules:
|
||||
- `random` gives each instance its own share of the tool's change for the whole stroke, from none of it to twice
|
||||
it (the Spinner: a turn either way), the same each time the stroke is applied.
|
||||
it (the Spinner: a turn either way; the Styler without `shift`: from none to the `userDefined` amount), the same
|
||||
each time the stroke is applied.
|
||||
- `average` moves each instance's value toward the mean of the instances within the brush at that point: the
|
||||
Scruncher its distance from their middle toward their mean distance, the Sizer the geometric mean of their sizes
|
||||
on the page, whatever their symbols, the Spinner their mean direction, the Stainer and the Styler their mean amount, the Screener their mean opacity.
|
||||
`alt` does not reverse it. An instance already at the mean is left as it is, and no undo step is added when
|
||||
no instance changes. The Screener's average, and the opacity a sprayed instance takes as its average, can be
|
||||
below the 5% that the Screener otherwise stops at.
|
||||
- With `userDefined` the Styler gives each instance under the brush the whole style, whatever the intensity or the
|
||||
pen pressure; `random` scales each instance's share by the brush strength there.
|
||||
- With `proportional` false a drag resizes along its own direction (a level drag the width, an upright one the
|
||||
height) and one point resizes both. With `affectsDensity` an instance also moves away from the point as it grows
|
||||
- With `proportional` false a drag resizes along its own direction: the width by the drag's horizontal share and
|
||||
the height by its vertical share (a level drag the width, an upright one the height, a 45° drag both alike), and
|
||||
one point resizes both. With `affectsDensity` an instance also moves away from the point as it grows
|
||||
and toward it as it shrinks.
|
||||
- A sprayed instance's `average` values are the means of the selected set's instances within `radius` of the
|
||||
stroke point: their spacing, size on the page (of any symbol), rotation and opacity, and the stain or style of
|
||||
@@ -3918,15 +3929,31 @@ already walks Image Trace. Short agent entry points:
|
||||
- `symbol.setDensity` moves each instance of a set along the line from the middle of the set's instances, to
|
||||
(1.15 − 0.1·`to`) / (1.15 − 0.1·`from`) of its distance from it (each factor at least 0.1), as one undo step, and
|
||||
adds none when no instance moves and every set already has density `to`. `from` is the density each set was
|
||||
created at or last given, and the `from` passed applies only to a set without one (a group named "Symbol Set" by
|
||||
created at or last given (a set duplicated has its source's, and a pasted set the one its source had at Copy),
|
||||
and the `from` passed applies only to a set without one (a group named "Symbol Set" by
|
||||
hand); every set then has density `to`, also one whose instances do not move (one instance, or each locked). A
|
||||
locked or hidden instance stays where it is. It returns `{ids, count}`: the sets changed and the
|
||||
instances moved.
|
||||
- A `method` or an attribute outside these values, a point's third number that isn't a number (in `symbol.spray`
|
||||
too, which does not use it), a `from` or `to` of `symbol.setDensity` outside 1..10, or no symbol set among its
|
||||
objects, is an error and changes nothing.
|
||||
objects, is an error and changes nothing. `symbol.spray` takes a `density` number outside 1..10 as the nearer end.
|
||||
- Average leaves an instance without a size (a scale of 0) as it is; the other methods change it. A stroke that
|
||||
changes no instance counts none and adds no undo step.
|
||||
- The symbolism tools with Shift held ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199),
|
||||
[the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)) send
|
||||
`shift: true` with `symbol.adjust`: a Shift-click with the Symbol Shifter brings the instances under the brush
|
||||
forward in the stacking order and Alt+Shift sends them backward; the Symbol Sizer keeps the set's density while it
|
||||
resizes; the Symbol Stainer and the Symbol Styler keep the amount of stain or style and move the color or style
|
||||
toward the current fill or the selected style. VectorCraft's own rules:
|
||||
- The Shifter moves each instance within `radius` of any stroke point one place forward among its siblings (with
|
||||
`alt`, one place backward), past the next one that is not under the brush, once for the whole stroke. It does not
|
||||
move them on the canvas. It returns `{count}`, the instances that moved.
|
||||
- The Sizer keeps each instance's center where it is, even with `affectsDensity`.
|
||||
- The Stainer moves an instance's paint toward `color` by the tool's amount at its distance from the point, and the
|
||||
Styler toward the style by the brush's strength there, whatever `method` is. A paint with no form between it and
|
||||
the new one (a solid color and a pattern) takes the new one at once. An instance without a stain or style is left
|
||||
as it is, and `alt` has no effect.
|
||||
- No undo step is added when nothing moves or changes.
|
||||
- Dynamic symbols: an instance of a symbol whose `type` is `dynamic` changes the appearance of objects in the symbol's
|
||||
art for itself only and stays linked. `symbol.instance.setAppearance {id?, path, fill?, stroke?, opacity?, blend?}`
|
||||
names the object by `path`, child indices in paint order from the art's root down through its groups (`[]` is the
|
||||
|
||||
@@ -1234,7 +1234,8 @@ Moved from the ROADMAP's "Shipped so far" on 2026-10-10. Update it when a featur
|
||||
- **The Symbols panel reads its current symbol from the document:** the Symbols panel and its panel menu read the current symbol on each frame without running `symbol.list`, which counts every symbol's instances by walking the whole document. The current symbol they show and act on is the one `symbol.list` reports, and an idle frame of the panel or its menu 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 µs instead of 48.5 ms in a release build (thread CPU time on Linux, median of 7 runs); in a small document the difference is too small to notice. Tests: `tests::brushsym::current_symbol_is_the_current_symbol_list_answers`, `panels::symbols::tests::current_is_the_current_symbol_list_answers`, `panels::symbols::tests::idle_frames_of_the_panel_and_its_menu_run_no_command`; the timing probe is `panels::symbols::tests::current_symbol_read_timing`.
|
||||
- **Expand of symbol instances:** Object › Expand turns selected symbol instances (without effects, not in perspective, in groups or placed documents too) into their art as Break Link to Symbol places it, one level deep, as one undo step; the Expand dialog's Fill and Stroke reach that art (`object.expand`, `crates/engine/src/tests/expand_symbols.rs`; estimated, score unchanged).
|
||||
- **Reset Transformation** ([Transform symbols](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/transform-symbols.html), [Symbols panel options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbols-panel-options.html)): the Symbols panel menu's Reset Transformation and the Control bar's Reset, shown while symbol instances are selected, give the selected instances their symbol's own scale again, without rotation or shear, as one undo step (`symbol.instance.resetTransform`); an instance in perspective is left as it is. VectorCraft's own rules: each instance keeps the center of its bounding box in place, reflection is removed too, and the menu item and the button are enabled only while a selected instance would change. Tests: `tests::brushsym::reset_transformation_restores_the_symbols_scale_and_keeps_the_center`, `reset_transformation_keeps_the_center_of_art_away_from_the_origin`, `reset_transformation_ignores_a_stored_size_that_is_not_positive`, `reset_transformation_leaves_unchanged_instances_and_refuses_bad_ids`, `panels::symbols::tests::reset_transformation_is_enabled_for_a_transformed_instance_and_resets_it`.
|
||||
- **Symbolism Tools Options** ([Symbolism tool options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbolism-tool-options.html), [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): the dialog a double-click on a symbolism tool opens has, besides Diameter, Intensity and Symbol Set Density, Use Pressure Pen (a pen's pressure is the intensity), Method (User Defined, Average or 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 new Symbol Set Density spaces the instances of the selected symbol sets (`symbol.setDensity`). VectorCraft's own rules: a Tool row lists the eight tools by name and shows the chosen one's options; Random gives each instance its own share of the change for the whole stroke; Average moves each value toward the mean of the instances under the brush; the starting values are Method User Defined, the Sprayer's six options Average, Proportional Resizing on and Resizing Affects Density off, so only a Sprayer stroke over instances of the selected set changes from before (its new instances take their mean values); the brush shows the intensity as a dashed ring. The Symbol Sprayer does not use Intensity or pen pressure. Tests: `crates/engine/src/tests/symbolism_options.rs`, `symbolism::tests` in `crates/tools`, `dialogs::symbolism_options::tests`.
|
||||
- **Symbolism Tools Options** ([Symbolism tool options](https://helpx.adobe.com/illustrator/desktop/manage-objects/traces-mockups-symbols/symbolism-tool-options.html), [the archived manual](https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=118)): the dialog a double-click on a symbolism tool opens has, besides Diameter, Intensity and Symbol Set Density, Use Pressure Pen (a pen's pressure is the intensity), Method (User Defined, Average or 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 new Symbol Set Density spaces the instances of the selected symbol sets (`symbol.setDensity`). VectorCraft's own rules: a Tool row lists the eight tools by name and shows the chosen one's options; Random gives each instance its own share of the change for the whole stroke; Average moves each value toward the mean of the instances under the brush; the starting values are Method User Defined, the Sprayer's six options Average, Proportional Resizing on and Resizing Affects Density off; with them, two strokes change from before: a Sprayer stroke over instances of the selected set gives its new instances their mean values, and the Symbol Styler applies the style by the brush's strength, so a click at the brush's center at the default intensity 5 applies it at half opacity instead of in full, and a stroke's samples add up; the brush shows the intensity as a dashed ring. The Symbol Sprayer does not use Intensity or pen pressure. Tests: `crates/engine/src/tests/symbolism_options.rs`, `symbolism::tests` in `crates/tools`, `dialogs::symbolism_options::tests`.
|
||||
- **Symbolism tools with Shift** ([the manual](https://web.archive.org/web/20210601162814/https://helpx.adobe.com/pdf/illustrator_reference.pdf#page=199), [the CS6 reference](https://web.archive.org/web/20220911143322/https://helpx.adobe.com/pdf/cs6/illustrator_reference.pdf#page=136)): a Shift-click with the Symbol Shifter brings the instances under the brush forward in the stacking order and Alt+Shift-click sends them backward; the Symbol Sizer with Shift keeps the set's density while it resizes; the Symbol Stainer and the Symbol Styler with Shift keep the amount of stain or style and move the color or style toward the current fill or the selected style (`symbol.adjust {shift}`). VectorCraft's own rules: the Shifter moves each instance one place among its siblings, once per stroke, without moving it on the canvas; the Sizer keeps each instance's center, even with Resizing Affects Density; a stain or style with no form between it and the new paint (a solid color and a pattern) takes the new paint at once; an instance without a stain or style is left as it is, and Alt has no effect on the Stainer or the Styler with Shift. The selected style is the one last clicked into the Graphic Styles panel's selection. Tests: `crates/engine/src/tests/symbolism_shift.rs`, `symbolism::tests::shift_reaches_the_tools_that_have_a_shift_form`, `panels::graphic_styles::tests::shift_click_selects_a_range_and_cmd_click_adds_or_removes_one_style`.
|
||||
- **The Symbols and Properties panels find selected symbol instances once per revision:** whether the selection or its groups hold a symbol instance (Break Link to Symbol), one with appearance changes of its own (Reset Symbol Instance and the Properties panel's Reset), or one Reset Transformation would change is worked out in one walk of the selected objects for each document revision, and later frames reuse it. The buttons and menu items are enabled as before. With one selected group of 300,000 paths, the two panels' reads took a median 5.1 to 5.7 ms of thread CPU time per frame; the first read after a change now takes about 3 ms and later frames about 5 ns (Linux, opt-level 3, median of 7 runs). In a small document the difference is too small to notice. Tests: `panels::symbols::tests::instance_flags_are_found_once_per_revision_and_match_a_walk_of_the_selection`, `properties_and_symbols_panels_walk_the_selection_once_per_revision`.
|
||||
- **Expand of dimensions:** Object › Expand, Expand Appearance, Create Outlines and Outline Stroke turn a dimension whose art they change into a plain group of that art, which stays as it is through later moves, scales and edits of what it measured; undo gives the live dimension back (`crates/engine/tests/it/dimensions.rs`; VectorCraft's own rule; estimated, score unchanged).
|
||||
- **Brush libraries** ([public source](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/create-new-brush-libraries.html), [import](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/import-brushes-from-brush-libraries-or-other-files.html), [Brushes panel](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/brushes-panel-overview.html)): Window › Brush Libraries, the Brushes panel's Brush Libraries Menu and its menu's Open Brush Library open each library in a library panel of its own, as swatch, graphic style and symbol libraries do. The built-in libraries (Art Ribbons, Ink and Wash, Calligraphic Nibs, Pressure Sensitive, Bristle Brushes, Pattern Borders, Scatter Shapes, Stipple, Game Trails, Energy Beams, Dry Media, Tech Circuit, Engraving, Arrows) are original brushes generated in code (`crates/engine/src/cmd/brushlib.rs`); Striped Ribbon's art is filled with the library's own pattern and Sparkles scatters the library's own symbol; Ink and Wash adds ink and wash brushes (the [help page](https://helpx.adobe.com/illustrator/desktop/paint-and-fill/apply-and-edit-strokes/about-brushes.html) lists an Ink brush library of strokes with varied thickness and texture; the names, shapes and opacities are VectorCraft's own): Tapered Ink, an art brush broad near its start that thins to a fine tip; Brush Pen, a calligraphic brush whose size follows the pen pressure; and Soft Wash and Pooling Wash, art brushes of translucent gray layers that take the stroke color as tints; Game Trails adds motion art brushes (Speed Line, Dash Trail, Burst Ray, Zigzag); Energy Beams adds laser and plasma art brushes (Laser Bolt, Plasma Arc, Charge Wave, Spark Trail); Dry Media adds grainy art brushes (Chalk Grain, Graphite Pencil, Wax Crayon, Charcoal Dust); Engraving adds fine-line hatching art brushes (Fine Hatching, Dense Hatching, Tapered Hatching, Broken Hatching). A click on a brush adds it to the document's Brushes as one undo step with every resource its art uses (patterns, symbols, swatches, graphic styles, images), makes it the current brush and, with paths selected, applies it to them in the same step; a brush the document already has is not added again and a different brush of the same name comes in numbered ("Wave 2"). Shift/Cmd-clicks select brushes for Add to Brushes; a brush dragged onto a path is added and applied to it, and one dragged onto the Brushes panel is added. Save Brushes… / the Brushes panel's Save Brush Library… write the document's brushes (or the selected ones) as a `.vectorcraft` library into the `Brushes` folder next to the preferences, listed under User Defined, or to a file; Other Library… reads the brushes of any document VectorCraft opens. Thumbnails, in the library panels, the Brushes panel and Brush Options, render brush art with the patterns and symbols it uses. Copying brushed art now carries the patterns and symbols its brush's art uses too. Tests: `crates/engine/src/tests/brushlib.rs`, `crates/ui-egui/src/panels/tests_brush_libraries.rs`, `panels::brushes::tests::library_brush_previews_show_the_patterns_their_art_uses`, `canvas::tests::a_library_brush_dropped_on_a_path_is_added_and_applied_in_one_step`.
|
||||
|
||||
Reference in new issue
Block a user