Files

2.1 KiB

Path editor

The project-authored path core accepts every SVG path command: M/m, L/l, H/h, V/v, C/c, S/s, Q/q, T/t, A/a and Z/z, including repeated parameter groups, implicit lines after move, packed arc flags, exponents, relative forms and multiple subpaths. It rejects non-finite values, malformed arity/flags and paths beyond the command limit.

Segments resolve to absolute geometry while retaining source command/form and fragment offsets for the command table. Serialization intentionally normalizes edited geometry; no editor metadata is emitted.

Controls

  • Every segment endpoint is an anchor.
  • Cubics show both controls. S reflects the previous cubic control and marks the resulting handle as derived/dashed until edited.
  • Quadratics show their one control. T reflects the previous quadratic control and marks it derived.
  • Arcs expose endpoint, radii and derived center controls and show rotation, large-arc and sweep flags in the command panel.
  • Handle radii and strokes use screen-oriented overlay styling so they remain usable across zoom levels.

The full selected-element/ancestor transform chain maps local path geometry into root space. Pointer coordinates use its inverse, including an active preview matrix; non-invertible chains disable handles. Dragging commits one transaction on release; arrow keys use 1, Shift+10 or Alt+0.1 units and merge safely.

Segment splitting uses the mathematical midpoint: linear interpolation for lines, de Casteljau for quadratic/cubic curves, and arc subdivision preserving the ellipse. Path reversal reverses every supported segment/subpath and adjusts controls/sweep where required.

Current limits

The 0.1.0 UI supplies drag/nudge, split at 50%, reverse and a read-only numeric command table. It does not yet supply node modes, multi-selection, deletion, conversion, open/close, join/break/combine, subpath-start changes, arbitrary split parameter, pen creation, snapping, simplification or boolean operations. Visual editing expands shorthand/relative commands to normalized absolute data; the dialog/help discloses that source-form change.