stroke.weightUp and stroke.weightDown now go through bucket_color_params and
item_target, as stroke.set and stroke.setAdvanced do, instead of skipping
item_target while the Live Paint Bucket is active. Each command still
refuses `target` and `aligned` with any tool, since neither is one of its
parameters.
- live_paint_bucket_refuses_a_bad_target_or_aligned (renamed from
live_paint_bucket_refuses_a_bad_target) runs with the Selection tool and
with the bucket, and adds stroke.set, stroke.weightUp, stroke.weightDown,
paint.swap and paint.default.
- live_paint_bucket_paint_and_stroke_commands_leave_the_selection_unpainted
adds stroke.set with `ids: null` and stroke.weightUp with `id: null`.
- The params text of the bucket-routed commands says a null ids or id
counts as none.
- docs/mcp.md names gradient.presets.apply next to paint.editGradient for a
picked symbol part, lists when a stop selected on the bucket's gradient is
deselected, and rewraps the two long lines.
object.align takes to: "auto", which aligns to the key object, key
anchor or key guide when the selection has one, else to the artboard
when exactly one object is selected and no anchor points are, else to
the selection.
New Action and Action Options have Choose Align To at playback
(automaticAlignTo on ui.action.new and ui.action.options), off by
default. With it on, playback sends to: "auto" for each object.align
step, without any artboard index the step stores, so the step uses the
active artboard; the stored steps keep their recorded params. Save
Actions writes the option, and a set that uses it is saved as file
version 7.
The dialog's strings have rows in every catalog, and docs/mcp.md
describes to: "auto", automaticAlignTo and file version 7.
Fixes#6972. Supersedes #7635.
Co-authored-by: yoriswind <yoriswind@yahoo.com>
- While the Live Paint Bucket is active, a paint or stroke command with
a null ids or id goes to the bucket's colors, as one without them does.
Before, it painted the selection, since other commands read a null ids
or id as no target.
- A bad target or aligned value is refused while the bucket is active,
as it is with any other tool, instead of changing the bucket's colors.
- stroke.weightUp and stroke.weightDown no longer read the selection's
active Appearance row while the bucket takes the weight, as stroke.set
and stroke.setAdvanced already do. The row was not used in that case.
- The params text of gradient.selectStop says that, while the bucket is
active, it selects a stop of the default paint's gradient, also with an
object of a symbol instance picked. docs/mcp.md says the same, and that
paint.editGradient without ids, id or item then changes the bucket's
gradient.
- docs/mcp.md again says that another tool chosen after the bucket keeps
its colors until a command or a new selection changes them.
* 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.
While the Live Paint Bucket is the active tool:
- each preview in one interaction starts from the colors the
interaction began with, so previewing paint.swap twice and committing
swaps once;
- a gradient stop selected on the selection's gradient is not selected,
and one selected on the bucket's gradient is not selected after
another tool is chosen;
- gradient.selectStop selects a stop of the bucket's gradient even
with an object of a symbol instance picked;
- gradient.presets.apply picks the fill or stroke by the active proxy,
not by the selection's active Appearance row;
- stroke.set and stroke.setAdvanced no longer read the selection's
Appearance row;
- the Stroke panel's Align Stroke buttons are on, as with nothing
selected, matching stroke.set, which takes every alignment.
The params text of paint.sampleColor, gradient.presets.apply,
stroke.set, stroke.weightUp and stroke.setAdvanced, the set_paint note
and the Live Paint paragraph of docs/mcp.md now describe this, and say
that the bucket takes only the color and weight of the stroke for new
art.
- 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.
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.
While a linear dimension is placed, each preview starts again from the
document as the placement began. The tool now reads the lines of the
other dimensions from that document (the new ToolContext field
interaction_doc), not from the document a command changed in between, so
a dimension that a command moves or hides and that the next preview puts
back does not leave the placed dimension on a level the committed
document does not have.
The engine test now drags a dimension out, runs dimension.update or
object.hide on the other dimension, releases, and checks the committed
line against that dimension as the document has it. The tool test that
checks which dimensions read lines also covers radius and diameter
dimensions.
On a cubic that counts as a circular arc but strays slightly from the arc's circle, the circle on the other side was placed against the arc's circle, a few points off the path. It now sits one radius out from the point on the path. The Undo test also checks that the click after Undo draws the first circle's own circle.
- Colors in the older color fields read gray (model 9) and CMY (model 4)
as the .cdr reader numbers them, instead of opening as black.
- A dash pattern whose lengths are all 0 draws a solid line, as for a
.cdr outline.
- A curve whose point field is too short for its count and is not whole
points with their type bytes is left out as damaged, instead of reading
coordinates as point types.
- A layer without a name comes in unnamed, and the importer names it by
its place, as for a .cdr drawing.
- After stray bytes, a chunk id starts with a letter and may hold digits
and spaces, and the id found must name a chunk the reader uses or have
a length that fits its list. Padding is no longer taken for a chunk.
- A canvas or a container in an object's attributes gives the
unsupported-objects warning.
- A page with no size and no bounds is 612 x 792 pt, VectorCraft's own
size, as for a .cdr page; PROVENANCE R61 says so. PROVENANCE also names
the other program's .cmx reader, read for field order.