Merging main made DIALOGS one entry short: Offset Objects and Match Objects
both joined it, so vectorcraft-ui-egui did not compile. The table now
declares seven entries.
A stacking match moved a clipping path out of its clip position and could
move a member out of an Intertwine group with its old overlap tiers. It now
refuses to move a clipping path, refuses a destination that would nest
Intertwine art, and clears the tiers of members that leave their group.
A stacking or rotate-only match no longer needs bounds on the source. A
size match measures each target after it is sized and turned, in its final
frame, and is refused when a target can't take the requested size, instead
of reporting success with the size unchanged. A target with no bounds that
needs to turn is refused.
With one object selected, the preview of the objects Start Global Edit
would take walked every selectable object again after each edit. After
an edit that replaced only the selected object, and left it the same
shape, size and appearance (a move), the same objects match, so the
outlines found before are kept.
The check compares the two documents: the layers may differ only in
the selected object and in the layers and groups that hold it, which
must be the same apart from their contents; the symbols and the rest
of the document must be the same. The selected object's form, box,
geometric size and fill and stroke are compared within a millionth of
the matching tolerance, since a move rounds the form differently in its
unit box. Any other change walks the document as before.
The preview is now also empty while a part of a dynamic symbol
instance is selected, as Start Global Edit is refused then.
The canvas kept the selection's outlines, anchors and dots only while the
document revision stayed the same, so every move command, nudge and drag
step built them again from every selected object. With 10,000 selected
rectangles one build took about 26 ms in a release build.
A move of whole objects now records the documents before and after it
and the distance (DocState::moved). The record is made only when each
moved object is still the node the transform left (no later pass, such
as the pixel grid snap, changed it), none is a member of a blend, and
every object the selection shows, the key object and the key anchor's
object included, is a moved object or inside one. Copies, scales, moves
of patterns alone and moves that resize type areas make no record.
The canvas moves its kept marks by that distance when the record names
the document they show, or the document a drag began with. It also keeps
them through a new revision of the same document and selection, as at
the end of a drag. Every other change builds them as before.
HeldLoad in the plug-in tests held a stored module's load for at most
1,000,000 yield_now calls and then let it go on its own. On a busy test
host that limit passed before the test released it, so the held file
loaded early: a_grant_given_elsewhere_since_the_load_removed_one_is_kept
and a_stored_module_without_permissions_ends_its_grant_when_it_installs
failed in a full engine run and passed alone.
- The hook now waits on a condition variable that release() and the
drop set. A load that runs on the test's own thread is not held and
sets gave_up, so a load that is no longer in the background still
fails the test instead of hanging it.
- stored_plugins_load_without_holding_the_plugin_changes_lock waited at
most 100,000 yields for the plug-in changes lock to be free; it now
waits until it is free.
- canceled_loads_forget_the_grants_of_what_they_installed releases the
held load before canceling, since cancel waits for a running load up
to its 10 second deadline.
- a_query_runs_while_the_plugins_load checks which commands wait for
the loads before it runs document.info.
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 frame after a document opens checked whether its Missing Fonts dialog
waits by building the whole dialog (opening::may_switch), and the dialog
pump then built it again to open it. Each build walked the document's type
and resolved every font it names: 6.5 ms over the two calls at 20,000
objects.
The rows are now kept in CanvasCache::missing_fonts for the document's
content version and the font database's generation, the same key Type ›
Find Font's cache uses, and both calls read them. An edit or a font that
loads while the dialog waits makes the next call list the fonts again. The
Fonts folder next to the document is still looked up when the dialog opens.
Rows are dropped once their document no longer waits.
text.missingFonts's answer is unchanged; its rows and its folder are now
two engine functions, missing_font_rows and fonts_next_to_document.
Tests count the row lists (one for the check and the open together) and
check that a document edited while its dialog waits lists its new font.
With one object selected and the Selection tool active, or while Global
Edit is on, every frame copied each highlighted outline out of the kept
list and made one overlay per object, which the canvas flattened and
stroked again. With 10,000 matching objects that was most of a 27 ms
frame.
highlights and similar now return the kept outlines as a shared
Highlights, grouped by layer color with a revision that changes only when
the outlines are found again. The session sends one Overlay::Outlines per
color, and the canvas shows it as a SelectionOutline keyed by that
revision, so the lines are stroked again only when the outlines or the
view change.
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.
The gate's turn_direction test failed because the `rotate` param of
addon.arrange.match did not say which way it turns. Its description now
says each target turns clockwise or counter-clockwise to the source's
angle.
Match, Set Size of Each, Swap, Replace and Sort now record the resolved
`scaleStrokes` value in their journal entry, so a replay scales strokes
the same way after the preference changes.
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.
- 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.
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.
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.
Object › Plug-ins › Arrange Tools › Match Objects… (addon.arrange.match)
makes the other selected objects match one source object: the key
object, or the top or the bottom selected object. Each can take the
source's width (height in proportion), height (width in proportion) or
both, its bounding-box angle, and its stacking place directly above it
in its layer or group, about a reference point, as one undo step. No
step is recorded when nothing changes, and invalid params are refused.
The dialog previews on the canvas; OK stays off while nothing is chosen
or the source is a missing key object.
Docs: docs/mcp.md, docs/target-app-parity.md, docs/ui-parity.md, ROADMAP.
symbol.options recorded an undo step and moved the revision whenever any
option was passed, unless only alignToPixelGrid was given with the value
the symbol already had. A newName equal to the current name, or a
registration, export type, 9-slice, type or pixel grid value the symbol
already has, now leaves the document and its undo history as they are.
symbol.replace with the symbol the instances already show recorded an
undo step too. It now records one only when an instance changes.
Both run through colorcmds::edit_if_changed, as the Symbol Shifter and
the other symbolism tools do.
PathItem handles carry the document's revert count, as page item
handles on main do, so path members find their path again.
setEntirePath and the path point setters throw a RangeError for a point
off the canvas. Opening a path whose closing segment is selected keeps
the edit. pathItems.add() leaves new art's paint as it was with New Art
Has Basic Appearance off. addDocument reports settings the built-in
preset refuses. appearance.setNewArt refuses a swatch that is not a
name. Writing one path's points looks only at that path afterwards.
With an object of a dynamic symbol instance selected by Direct Selection,
transparency.set without ids changes that object's opacity and blend mode
for the instance, and the Transparency panel shows those values. The
transparency.info command still reported the instance's own opacity and
blend mode. Without ids or id it now returns the panel's values
(Session::transparency_info), so it reports the part's opacity and blend
mode with the instance's isolate and knockout. With ids or id it still
reports those objects.