Skip to content

Part of #852: Brush Options for Calligraphic and Bristle brushes, pen pressure - #906

Merged
bflatastic merged 1 commit into
mainfrom
feat/852-pressure-brushes
Oct 10, 2026
Merged

bflatastic merged 1 commit into
mainfrom
feat/852-pressure-brushes

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Part of #852.

Brush Options. Double-clicking a brush in the Brushes panel (or the panel menu's Brush Options…, ui.brushOptions) opens its options:

  • Calligraphic Brush Options: Name; Angle, Roundness and Size, each Fixed, Random or Pressure with its Variation; live previews of the nib (with the variation's range ghosted) and of a stroke.
  • Bristle Brush Options: Name, Shape and the bristle sliders (length, density, thickness, paint opacity, stiffness).
  • OK runs brush.options; strokes painted with the brush update. A name another brush has keeps the dialog open. Scatter, Art and Pattern Brush Options are next.

Pen pressure. The Paintbrush records the pen pressure along a stroke (path.freehand takes [x, y, pressure] points; a mouse presses fully), and the stroke keeps it. A Calligraphic brush with Pressure variation changes its nib along the stroke, from the value less the variation at the lightest pressure to the value plus it at the heaviest, kept within each value's range; the sweep is sampled densely (capped) where the nib varies. Graphic styles and Copy Appearance don't carry a stroke's pressure. Brushes saved before keep their Random variation (modes absent means Random where the variation isn't zero).

Limit: pen pressure doesn't reach the app on macOS yet: winit 0.30 reports no pressure there. On Windows and Linux (X11, XWayland) it does.

Tested:

  • cargo xtask ci (all 7 steps).
  • Brush tests: size, angle and roundness follow the recorded pressure along the stroke within their ranges; brushes saved without modes keep their Random look; junk definitions and pressures never draw non-finite art.
  • Engine tests: the Paintbrush records pressure and it lasts through saving and every export (a mouse stroke records none); continuing a stroke joins its pressure; pressure stays with its own path (new art, graphic styles and Brush Options edits leave it); brush.options sets the modes and refuses bad ones; command_sweep cases.
  • Live: "6 pt. Flat" set to Size: Pressure, variation 8 pt, then a freehand stroke with pressure rising from 0.05 to 1 and back: thin at both ends, full in the middle. Brush Options for it shows the nib with its range and the stroke preview, Angle and Roundness Fixed, Size Pressure.

🤖 Generated with Claude Code

… pressure

Double-clicking a brush in the Brushes panel (or the panel menu's Brush
Options…) opens its options. Calligraphic Brush Options: Angle,
Roundness and Size, each Fixed, Random or Pressure with its Variation,
over live previews of the nib and of a stroke. Bristle Brush Options:
Shape and the bristle sliders. OK runs brush.options; strokes painted
with the brush update.

The Paintbrush records the pen pressure along a stroke (path.freehand
takes [x, y, pressure] points), and a Calligraphic brush with Pressure
variation changes its nib along the stroke, from the value less the
variation at the lightest pressure to the value plus it at the heaviest.
Brushes saved before keep their Random variation. Pen pressure doesn't
reach the app on macOS yet (winit 0.30 reports none there).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@bflatastic
bflatastic merged commit ba2fc64 into main Oct 10, 2026
3 of 4 checks 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