Skip to content

Part of gap 5: Scatter, Art and Pattern Brush Options - #948

Merged
bflatastic merged 1 commit into
mainfrom
feat/brush-options-scatter-art-pattern
Oct 10, 2026
Merged

bflatastic merged 1 commit into
mainfrom
feat/brush-options-scatter-art-pattern

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Part of ROADMAP gap 5 (brushes).

Double-clicking a Scatter, Art or Pattern brush in the Brushes panel (or the panel menu's Brush Options…) opens its options dialog, as Calligraphic and Bristle brushes already did. OK runs brush.options, and every stroke painted with the brush redraws.

  • Scatter Brush Options: Name; Size, Spacing, Scatter and Rotation, each with two values and a mode:

    • Fixed uses the first value.
    • Random picks between the two values.
    • Pressure goes from the first value at the lightest pen pressure to the second at the heaviest.

    Also Rotation relative to Page or Path. The stroke pipeline now gives scatter brushes the recorded pressure. Brushes saved before keep their look: Random where their two values differ, Fixed otherwise.

  • Art Brush Options: Width; Brush Scale Options (Scale Proportionately, Stretch to Fit Stroke Length, Stretch Between Guides with Start and End); the four Directions; Flip Along and Flip Across.

  • Pattern Brush Options: Scale and Spacing; the five tiles (Outer Corner, Side, Inner Corner, Start, End) shown with their art or "None"; Flip Along and Across; Fit (Stretch to fit, Add space to fit, Approximate path).

  • All three: Colorization (None, Tints, Tints and Shades, Hue Shift, with a Key Color picked from the art's colours) and a live stroke preview.

  • Untrusted input: brush definitions from files and commands are kept within their ranges by Brush::sanitize, which also covers Calligraphic and Bristle values. Unknown choices are refused and change nothing.

  • brush.options and ui.brushOptions document the new params. Interface strings are translated in every complete catalogue, and the ROADMAP is updated.

Most ranges aren't confirmed against public docs. Scatter Rotation −180..180° is; the others are set generously (Scatter Size and Spacing 1–10000 %, Scatter ±1000 %, Art Width 1–1000 %, Pattern Scale 1–10000 %, Spacing 0–10000 %) so that no value an existing brush uses is clamped. Left for later: stylus tilt, bearing and rotation; Art brush Overlap; pressure on Art Width and Pattern Scale; generated corner tiles; picking new tile art; the Key Color eyedropper.

Tested:

  • cargo xtask ci (all 7 steps).
  • New tests:
    • Scatter modes and pressure, sanitizing, and art colours.
    • scatter_art_and_pattern_brush_options_update_strokes.
    • Eight junk brush.options cases in the command sweep.
    • Three headless dialog tests.
  • Live with a release build: each of the three dialogs opens on a default brush (Confetti, Charcoal, Chain) with its fields, tiles and preview. Setting Confetti's Size to Fixed at 250 % and confirming is what brush.get returns afterwards.

🤖 Generated with Claude Code

Double-clicking a Scatter, Art or Pattern brush in the Brushes panel (or the
panel menu's Brush Options...) now opens its options dialog, as Calligraphic
and Bristle brushes already did. OK runs brush.options and every stroke
painted with the brush redraws.

- Scatter Brush Options: Name; Size (10-1000 %), Spacing (10-10000 %),
  Scatter (-1000-1000 %) and Rotation (-180-180 deg), each Fixed (the first
  value), Random (between the two values) or Pressure (the first value at
  the lightest pen pressure, the second at the heaviest); Rotation relative
  to Page or Path. Scatter brushes now keep these modes (`modes`); brushes
  saved before keep their look (Random where the two values differ).
- Art Brush Options: Name; Width (1-1000 %); Scale Proportionately, Stretch
  to Fit Stroke Length or Stretch Between Guides with the guides' Start and
  End (% of the art length); the four Directions; Flip Along and Across.
- Pattern Brush Options: Name; Scale (1-10000 %), Spacing (0-10000 %); the
  five tiles (Outer Corner, Side, Inner Corner, Start, End) drawn with their
  art or None; Flip Along and Across; Stretch to fit, Add space to fit or
  Approximate path.
- All three: Colorization (None, Tints, Tints and Shades, Hue Shift with its
  Key Color picked from the art's colours, the most used one by default) and
  a live preview of a stroke painted with the edited brush.

Brush definitions from files and commands are now kept within these ranges
(Brush::sanitize, also for Calligraphic and Bristle values); unknown modes,
directions, fits or colorization methods are refused. The brush.options and
ui.brushOptions docs list the new params and fields. Tests: the brush model
(modes, pressure, sanitizing, art colours), engine params reaching the
brush and strokes redrawing, junk params in command_sweep, and headless
dialog tests for each dialog.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic merged commit 7d6be31 into main Oct 10, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant