* SVG export: preserve document unit in viewBox and width/height (#864)
When exporting SVG documents with physical units (mm, cm, in, pc), emit
the physical unit suffix on the root <svg width=... height=...>
attributes while keeping viewBox numbers and inner coordinates in 1:1 points
per SVG 1.1 coords §7.10. This avoids the 75% scaling mismatch when opening
drawings in external tools such as Inkscape or LightBurn, and preserves
the document unit setting across save/open round trips. Unitless documents
(points, pixels) continue to emit unitless dimensions.
Tested via export_physical_units_writes_unit_suffixes in vectorcraft-svg
and full round-trip svg_round_trip_preserves_document_units in vectorcraft-engine.
Ran cargo xtask ci (fmt, clippy, tests, xtask gates).
* SVG export: preserve nonzero width and viewBox on extreme small dimensions
Once a shape has used its 1,048,576 splits at any depth, Add Bounding Circle
still splits each further curve into up to 8 pieces, from a second budget of
7,340,032 splits shared among the shapes as the first one is. Only after
both are used up does a curve count whole by its control points' hull cut
down to its bounding box. Before, every curve past the first budget counted
whole, which can make the circle around a circle about 14% larger; with the
8 pieces the fit stays less than 0.3% larger.
- The comment on the shared budget no longer claims that the shape around
one object is independent of the other objects selected.
- shapes::enclosing_circle and convex_hull move below the star helpers.
- The "Each" label mapping in the dialog form sits after "Flip Cols".
- docs/mcp.md and docs/target-app-parity.md describe both budgets and the
size of the fit before the 0.01 pt is added.
- Export Selection to HP-GL checks the selection and starts Pen Table
from its pens, as the export writes it, and `exportSelection` is no
longer remembered for the next whole-document export.
- Pen Table with options or an artboard choice the export refuses keeps
One Pen per Color and shows the error, instead of starting from one
black pen that corrected options would keep. `automatic_pens` returns
that error.
- `automatic_pens` refuses `rect`, as `check` and the export do.
- A save panel shown in line that is canceled keeps the dialog open,
and a canceled save panel keeps the options remembered before.
Rows dragged to the trash before isolation mode started went to
layer.delete at once when none needed a question. ui.layerDelete now
returns an error for any row outside the isolated art, given or dropped,
and deletes nothing. OK in its question with no rows given deletes the
highlighted rows the panel lists, not every highlighted row.
Add Bounding Circle splits the curves of one command 1,048,576 times at
most in all, shared equally among the shapes with `each`. A piece that
still bends after the last split counts by the hull of its control points
cut down to its bounding box, so a large circle near the canvas edge keeps
a close radius.
- A path of a compound path selected on its own counts as an object, as
`object.transform` moves it, for both commands.
- A small loop whose ends meet gets a circle instead of being taken for a
single point.
- The smallest enclosing circle measures its radius from the center it
returns, after the move back from the first point, and does not copy
the hull to do so.
- The params text, docs/mcp.md and docs/target-app-parity.md describe the
limit and the compound path rule.
- OK and Delete on one or several existing points are refused when those
points changed in any way since the dialog opened (place, widths,
stroke weight, or pairing as a discontinuous point), or when another
document is active.
- OK with no width changed checks the selection before it closes.
- An untouched Total Width above 100000 pt no longer blocks OK; a value
set above 100000 pt is still refused.
- A width set into a field that OK refuses stays there when another
field is set afterward, and a negative width typed for several points
is refused at OK instead of becoming 0.
- `ui.widthPointEdit` refuses `index` together with `t`.
- Double-clicking a selected width point passes every selected entry,
so points at nearly one place are all edited.
An isolated ruler guide left the Layers panel with no rows, since the
panel lists no object row for a ruler guide. object.isolate now returns
"ruler guides can't be isolated" and isolation mode stays as it was.
The Sizer's and the Sprayer's Average compare each instance's size on the page, so a set that
holds instances of different symbols meets at their mean drawn size. A symbol without a recorded
size is measured by its art, once per command. With Size: Average and no instance under the brush,
a sprayed instance has its symbol's own size whatever `scale` is, and new instances are spaced by
the size they are placed at. With Use Pressure Pen, a drag sample at the same position is kept when
the pressure changes by 0.05 or more.