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.
- apps/vectorcraft-web: egui_extras moves to the wasm32 dependencies.
Its only use is src/web.rs, which builds only for wasm32, so cargo
reported it unused on native builds.
- apps/vectorcraft: drop the socket2 dev-dependency. Its loopback
tests left control_server in #8800 and nothing uses it now.
- xtask: the doc-test steps (`cargo xtask ci shard` and the workspace
doctests) leave out packages whose only library target is a cdylib,
dylib or staticlib. Cargo printed "doc tests are not supported for
crate type(s) `cdylib`" for vectorcraft-thumbnail-handler. Packages
without a library stay selected, so the shard keeps its features.
Warnings on the build host, before and after (cache warm shard
`cargo test -p vectorcraft-mcp -p vectorcraft -p vectorcraft-cli
-p vectorcraft-web -p xtask --lib --bins --no-run` on a fresh build, and
`cargo test -p vectorcraft-thumbnail-handler --doc`): 4 before, 1 after.
The one left is `vectorcraft-testkit` in apps/vectorcraft-cli: only the
integration tests use it, and the warm step builds only library and
binary tests.
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.
The Windows leg found no cache on every pull request, because only a push or manual run on
main saves one and the workflow had no push trigger. A push to main that touches the same
paths now saves the entry that pull requests restore.
Both test runs now select the app and the UI crate together, so Cargo resolves features once
and the printps run reuses the first run's dependencies instead of rebuilding 94 crates. The
first run keeps every app test (the binary's unit tests and `tests/it`).