After every edit, the pixel grid, color mask, Objects on Path, Shaper and
symbol instance passes, and the inline graphics refresh, pair each object
with its counterpart from before the edit. Each pass read both objects to
compare their ids before it found that they were the same node, so moving
one object in a layer of 20,000 objects read all of them in four passes.
The color mask pass is new since v0.24.1, and object.move became slower
than in that release.
The new vectorcraft_doc::changed_nodes does the pairing for all six. An
object that is the same node at the same position is skipped by a pointer
comparison; only changed and new objects are looked up by id.
object.move of one rectangle in a document of 20,000 objects, release
build, median CPU time of 2,000 moves: main 1.25 ms, this change 1.08 ms,
v0.24.1 1.06 ms. The passes' share of the move went from about 30% to 5%
in a profile.
The name, note, hidden, locked, opacity, blendingMode, position, left,
top, width and height setters checked the assigned value before the
item, so a bad value on a removed item reported the value error instead
of "Stale page item". Each setter now looks up its item first.
Follow-up to #9288.
- Removing the last anchor of a closed path with its closing segment
selected also deselects the first anchor, the segment's other end.
- Removing a point puts back new art's paint, so a default stroke width
a script set still applies to the next path it draws.
- A removal that leaves the direct selection as it was waits with the
other point changes, unless every remaining anchor is now selected,
the selection refers to points that are gone, or the path is in an
Objects on Path group.
- Reading the points of a path first writes the waiting point changes
of another path in the same Objects on Path group.
- Writing a path in an Objects on Path group checks the other tracked
paths in the outermost such group, so their PathPoint handles go stale
when the group moves them, even after an undo.
Docs: docs/mcp.md, docs/target-app-parity.md.
Hit walks measure every path's culling box with PathData::control_bounds,
which read every anchor of the path on every call. Since anchors are kept
in shared chunks, that read follows two more pointers per path and goes
through the chunked iterator, so each node of a hover or cursor walk cost
about twice what it did before the chunks.
Each subpath's anchor list now keeps the box round its points and handles
once it is measured (Anchors::control_bounds), and every change to the
list clears it. A copy of the list keeps the box too. control_bounds
unions the subpaths' boxes, with the same result as before.
- anchors.rs: control_bounds reads the anchors once until they change,
counted by measured_control_anchors; each change to the list clears it.
- Tests count the anchors read: a list reads them once across calls and
copies, again after each kind of change, and a hover past 100 squares
reads none after the first.
The Stroke panel showed the stroke editor's rows with a label column of
their own, so the Alignment, Caps and Corners buttons and the Miter
Limit and Dash offset fields started left of the Weight, Arrowheads and
Profile controls. The panel now turns on StrokeEditor::host_labels
(craft-libs#4227, in the pinned craft-libs), and the editor's rows read
the label column of the panel's Stroke Options group.
the_panel_rows_start_their_controls_at_one_x now also checks the
Alignment, Caps, Corners, Miter limit and Dash offset controls.
The app's root look now sets PresetCardLook::PageTile in place of Page,
so each preset card in New Document draws on a light veil of the scrim
with its paper on it. A card that is not selected now stands apart from
the dialog's surface. The craft-libs pin at 186a229c8d already has the
look (storytold/craft-libs#4180).
The new test resting_preset_cards_stand_on_a_tile checks that a resting
card is covered by a veil of the scrim and holds its white paper; it
fails with the old Page look.
The craft-libs pin now includes storytold/craft-libs#4147 and #4195. A
wrapping SpaceBetween row keeps its children at both edges when they fit
on one line, and a check box in a row inside a field shows its own label.
- Document Info: a row wraps through the shared row layout instead of
measuring its label and value first. A row that fits keeps its value at
the end; otherwise the value moves under the label.
- Image Trace: the Fills and Strokes check boxes in the Create field show
their own labels, without a nested field for each.
A new test checks that a Document Info value that does not fit beside
its label moves under it.
The tool rail's footer region draws its own rule and gap since
craft-libs#4140, so the divider at the top of bottom_controls drew a
second rule. Remove it, and have the rule test count exactly one.
A hit test for the selection tools first walks the document without
looking inside unfilled closed paths, and when that finds nothing it
walked the whole document again to look inside them. With the pointer
resting over empty pasteboard that doubled the hit walks on every
frame.
The first walk now notes whether an unfilled closed path holds the
point, and the second walk runs only when one does. Select Behind
(objects_at) and Direct Selection in a dynamic symbol's art
(symbol_part_at) skip their second pass the same way. Hit tests that
do not look inside unfilled paths measure no interiors.
The craft-libs pin (186a229c8d) includes storytold/craft-libs#4138: a
group or tab dragged out of a dock column collapsed to icons now floats
or docks expanded in craft-libs itself, while a whole icon column that
floats stays collapsed. The floated_from_icons pass added by #9964
expanded those windows a second time after each dock pass, so it is
removed and the dock pass stores the area's workspace as it did before.
The test from #9964,
a_group_dragged_out_of_the_icon_column_floats_expanded_and_its_tabs_switch,
is kept and passes on craft-libs alone.
end_folder uses its Session and StoreTurn only in the native arm that
finishes loaded modules and saves the disabled list. The wasm32 build has
no such arm, so rustc reported both parameters as unused there. The
function now marks them used under cfg(target_arch = "wasm32"), as
install_folder above it already does.
cargo check -p vectorcraft-engine --target wasm32-unknown-unknown:
2 warnings in vectorcraft-engine before, 0 after. The manifest and patch
warnings it also prints are unchanged.
Cause of the CI failures on 212090fd7a:
- main's dialogs::new_document test a_presets_rows_reach_the_document_create_makes
sets artboardLayout.rows to 3.6 and expects 4, but this branch refused a
rows value that was not a whole number. rows now rounds like columns and is
still refused outside 1 to 1000.
- script_host_vs_scriptcheck listed Document.prototype.pathItems=, the
setter of main's placeholder. This branch makes pathItems a read-only
collection, like pageItems, so the row goes.
The pinned egui replays a region that did not change as one
Shape::PaintChunk of clipped shapes. Test helpers that walked
out.shapes by hand stopped at the chunk, so text, meshes, rects and
lines painted inside it were missed.
- Add painted_shapes and flat_painted_shapes next to text_shapes in
tests/labels.rs. They open Shape::Vec and Shape::PaintChunk in paint
order and compose each shape's transform and clip the same way.
- Route every remaining hand-written text and shape walk in the
ui-egui tests through text_shapes or these helpers, keeping each
test's assertions and its first-painted or last-painted order.
- panel_readout_copy: the Link Info Name check called the removed
text_shape helper and did not compile; it now reads visible_paint.
Format the file.
- PathPoint.remove() renumbers the direct-selected anchors and segments
after the removed point, and drops the removed anchor and the selected
segments it ended, through selection commands after the points are
written. A removed anchor no longer stays selected, and the same index
no longer selects a different point.
- pathItems.add() reads new art's paint after the target document is
active, so a path added to a document in the back keeps the stroke
that document's selection gives new art.
- Paths a script draws put new art's paint back afterwards, so a
defaultStrokeWidth the script set applies to every path it draws, not
only the first.
- appearance.setNewArt refuses a fill or stroke paint with a setting a
paint does not take, such as opacity, instead of applying the rest.
Keep the existing pointer and text expectations on composed paint output. Preserve paint order and apply the retained transforms and clipping when finding drawn controls.
Cause of the script_dom and script_dom_paths failures: main's 9872e6b679
("page items report their own members, and lists start with the topmost
object") made pageItems, pathItems and the selection list art topmost first.
The branch's tests still indexed the objects bottom first, so pageItems[1]
and pathItems[0] named the other object. The tests now make the objects in
the order the lists read them, and index them topmost first.
The own-members test asked about rotate, which this branch makes available,
so it now asks about transform, which is not available yet.
The fallback test for addDocument relied on five 1,000,000 pt artboards not
fitting, but a new DocumentPreset puts them in one column. It now unsets the
layout so the built-in preset puts them in one row, and the test fails when
addDocument falls back to the saved preset of the same name.
Collect painted swatch labels from retained paint chunks as well as flat shapes. Keep the localized-label and physical pointer assertions unchanged in scope.
Object › Plug-ins › Arrange Tools › Offset Objects… (addon.arrange.offset)
puts the selected objects one after another in a row (left to right) or
a column (top to bottom), each a gap past the one before it; a negative
gap overlaps them. The order is the stacking order from the back or the
position (left or top edges), and Reverse Order runs it the other way.
The first object stays where it is, and the others move only along the
row or column, keeping their place across it. Objects are measured by
their visual bounds, a clipping group by its mask. One undo step, none
when nothing moves; bad params are refused.
The dialog has Direction, Gap, Order and Reverse Order with Preview.
Docs: docs/mcp.md, docs/ui-parity.md, docs/target-app-parity.md, ROADMAP.