Files
Artstr-Studio/docs
thePR0M3TH3AN b825181356 Pen tool Phase D close-out: add/delete anchor, smooth/corner, bbox refit
Finished the deferred Phase D pieces from PEN_TOOL_FEATURE.md.

New affordances on the editable pen layer:

- Click a segment between anchors → inserts a new anchor at the
  click point via de Casteljau cubic split. Curve shape is
  preserved exactly: a's hOut, b's hIn, and the new mid-anchor's
  handles all derive from the split. Lines (no handles either
  side) get a plain midpoint anchor with no handles. The new
  anchor is selected and immediately drag-able.
- Right-click an anchor → delete it. Suppresses the browser
  context menu on the pen overlay always.
- Backspace / Delete with an anchor selected → delete it.
  Layer-delete still wins when no anchor is selected. The pen
  tool's selected-anchor sentinel `_penSelectedAnchor` is reset
  on tool change.
- Alt-click an anchor → toggle between `kind: 'corner'` (handles
  move independently) and `kind: 'smooth'` (handles stay mirrored
  across the anchor). Promoting to smooth re-derives the missing
  handle (or re-mirrors both if independent) so the curve
  actually becomes continuous. New nodes from pen click-drag
  default to smooth; new nodes from a single click are corners.
- Drag an anchor or handle past the original 0–100 viewBox →
  the layer's bounding rect auto-refits. New `refitPenLayerIfNeeded`
  computes the bbox over all nodes + handles, translates
  layer.x/y by the bbox offset (scaled to current w/h), updates
  layer.w/h, then remaps every node into the new 0–100 space.
  Path stays visually anchored to the canvas — no more clipping
  at the layer edge.

Anchor glyphs now distinguish kind: smooth = circle (existing
look), corner = square. The selected anchor renders with an amber
stroke (#f97316) so the Backspace-to-delete target is unmistakable.

Spec updated to mark Phase D complete and the deferred items
shipped. Rotated paths are still not node-editable in v1 (the
deferral remains).
2026-06-01 16:25:38 -04:00
..
2026-05-15 21:13:49 -04:00