Skip to content

M3: Width tool depth and the new-art appearance template (M3.64, M3.65) - #58

Merged
bflatastic merged 2 commits into
mainfrom
pr/m3-width-tool-new-art
Oct 4, 2026
Merged

bflatastic merged 2 commits into
mainfrom
pr/m3-width-tool-new-art

Conversation

@bflatastic

Copy link
Copy Markdown
Member

Part of M3 (Paint & appearance). The Width tool gets Width Point Edit, multi-select, Alt-copy and discontinuous points, and new art can inherit an appearance template.

  • M3.64: Width tool depth.
    • Width Point Edit: double-clicking a width point opens it (dialog widthPoint, or ui.widthPointEdit {id, index}). It has Side 1, Side 2 and Total Width with a link, Adjust Adjoining Width Points, and Delete.
    • Multi-select: Shift-click adds or removes width points. Dragging one of several selected points moves or widens them all in one undo step; Delete removes them all.
    • Copy: Alt-dragging a point's centre copies it (stroke.widthPoint.copy {id, index, t}).
    • Discontinuous points: dropping a point onto another makes a discontinuous point, a step in width. The shared stroke geometry draws the step, and flipping a profile swaps its sides.
    • Commands: stroke.widthPoint.set {adjustAdjoining?}, stroke.widthPoint.remove {indices}. document.inspect reports strokeOptions.widthPoints.
    • Model: a profile may hold two points at the same position. There are no new fields, and there's a native round-trip test.
  • M3.65: new-art appearance template.
    • Model: PaintDefaults gains appearance, opacity, blend, style and inherited. The preferences gain newArtBasic (on by default).
    • Nothing selected:
      • stroke.set and stroke.setAdvanced set up the next object drawn (cap, join, dash, arrowheads, profile…). Shapes, lines, grids, Pen, Pencil and Curvature all use it.
      • graphicStyle.apply (with add too) sets the template. New art is linked to the style, and the style's gradients land on the new object's bounds.
    • New Art Has Basic Appearance: turned off (appearance.setNewArtBasic {on?}, the Appearance panel's flyout), new art takes the last selection's whole appearance: every fill, stroke, effect, opacity and blend mode.
    • Other commands: paint.default resets the template, and appearance.newArt reports it.
    • Panels: with nothing selected, the Stroke and Appearance panels show the template, and clicking a graphic style applies it to the template.

docs/mcp.md and docs/control-protocol.md cover the commands and dialog.

Known limits:

  • Editing a selected object's stroke doesn't carry its cap or dash to new art; weight always does.
  • Clicking a style in the graphic style library panel with nothing selected only adds it to the document.

Checks

Rebased onto d974093 (#57). cargo xtask ci passes all 7 steps (fmt, clippy, test, assets, brands, layers, wasm): 1,852 tests, 0 failed.

New tests:

  • tool multi-select and drag;
  • Alt-drag adds one point;
  • the step renders (area check and a pixel probe);
  • the dialog in a headless frame, without stretching with the screen;
  • a round cap plus dash carries to a new rectangle;
  • with the option off, two fills and a shadow carry over;
  • preferences round-trip;
  • a headless Appearance panel frame.

🤖 Generated with Claude Code

bflatastic and others added 2 commits October 5, 2026 04:38
… discontinuous points

Double-clicking a width point opens Width Point Edit (Side 1, Side 2, Total Width, a link
keeping the sides equal, Adjust Adjoining Width Points, Delete; dialog `widthPoint`, also
`ui.widthPointEdit`). Shift-click selects several width points, which drag and widen together
as one undo step; Alt-dragging a point's centre copies it (`stroke.widthPoint.copy`); dropping a
point onto another makes a discontinuous point (two points at the same t), and the stroke's
width steps there. `stroke.widthPoint.set` takes `adjustAdjoining`, keeps a discontinuous point
when only its widths change, and `stroke.widthPoint.remove` takes `indices`. Flipping a profile
along the path swaps the sides of its steps; `document.inspect` reports `widthPoints`.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… with nothing selected, New Art Has Basic Appearance)

With nothing selected, Stroke panel edits (stroke.set / stroke.setAdvanced: cap, join, dashes,
arrowheads, profile...) and a graphic style clicked in the Graphic Styles panel
(graphicStyle.apply, add too) set up the next object drawn: its stroke options, fills, strokes,
effects, opacity and blend mode, linked to the style. The Appearance panel's New Art Has Basic
Appearance (appearance.setNewArtBasic, preference newArtBasic, on by default) now works: off,
new art takes the whole appearance of the last selection. paint.default resets the template,
appearance.newArt reports it, and with nothing selected the Stroke panel shows its stroke and
the Appearance panel its rows. PaintDefaults gains the template appearance, opacity, blend
mode and style.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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