After a move, the check that a view can move the selection's marks
instead of building them again looked each moved object up by id three
times: the object, its parent's id and the parent. With 10,000 objects
selected that was 30,000 lookups after the edit. The check now keeps
each object's place from the transform and reads the object and its
parent there, so the move looks each object up once, as before.
Leaving the Shape Builder saved every one of its options, so preferences
from earlier versions hold pickColorFrom "artwork" whether or not it was
picked, and kept the old default after Color Swatches became the default.
The preferences now carry toolSettingsVersion, written as 1 once a tool
setting is stored. Applying preferences without it changes a saved
Shape Builder pickColorFrom "artwork" to "swatches" and writes the
version, so Artwork picked after that is kept at the next launch. A
saved "swatches" and preferences without a saved pickColorFrom are
unchanged.
Docs: docs/mcp.md and the tool options params text.
While the Shape Builder is active, a fill picked from a swatch or a color
changes only the current fill, and the selected art keeps its own. With
Pick Color From set to Artwork, a merge takes the look of the art, so the
picked color never reached the merged shape and the tool looked as if it
could not fill.
Pick Color From now defaults to Color Swatches: a merge fills with the
picked color, and the Left and Right arrow keys step through the color
swatches. A pickColorFrom saved with the preferences is kept, so a saved
Artwork stays Artwork; preferences saved without one take Color Swatches.
The shapeBuilder.merge command still defaults to artwork when its
pickColorFrom is left out.
Docs: docs/mcp.md and the tool options params text.
With 10,000 objects selected, object.move walked the document's tree five
times and looked each object up by id three times. It now walks the tree
three times and looks each object up once.
- The selected roots (for the menus, for Move, Rotate, Scale and the
other transforms, for Copy and Cut, and inside an isolated group) are
put in paint order and reduced to their top-level objects from one walk
instead of two.
- A transform finds the objects' places once for Transform Patterns and
for the edit, instead of once for each.
- After a transform, the check for a pixel-aligned compound path reads
the parent at the object's place instead of looking the object and its
parent up by id.
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.
several_colors kept looking up the remaining ids, walking the remaining
children of a group and the rest of a pattern tile after it had found two
colors. It now stops as soon as the second color turns up.
CI failed `the_font_menu_preview_reads_the_menus_when_it_ends`: with the
state key holding the revision an interaction began from, the key no
longer changed when the font menu's preview began, so the menus were not
read then, though commands that check for an open interaction change
state at that point and the menu stays open while it previews.
The key now also holds whether an interaction that the active tool did
not begin is open. A tool's drag still keeps the key as it begins; a
dialog's, a panel's or the font menu's preview changes it as it begins
and as it ends. `Interaction::by_tool` reads the flag for the UI crate.
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 an edit the selection keeps no record of its paints, so the Fill
and Stroke chips and the Stroke and Width Profile rows looked up the
groups around every selected object for Live Paint faces and edges each
time they were drawn. DocState::live_paint_covered_kept keeps an empty
answer for that version of the document and those objects.
The Recolor quick action listed and sorted every color of the selection
to see whether it held more than one. Session::several_colors_used reads
the same objects and pattern tiles and stops at the second color.
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.
While an interaction is open (a move, scale or shape drag, a dialog's
preview, a typing session), the menus' state key left the document
revision out, so the key changed in the frame the interaction began and
the menus rebuilt every row's state for it, on top of the rebuilds for
the press and the release. A rebuild costs about 8 ms on small documents
and about 160 ms with 10,000 objects selected.
An interaction now records the revision it began from, and the key uses
that revision while the interaction is open. The key stays the same as
a drag begins and through its previews, and changes when it ends.
The new test drives a Selection tool move through the whole app and
counts the rebuilds in each frame: one for the press and one for the
release, none as the move begins.
The menus rebuild every panel menu's states on each edit and selection
change. With 10,000 objects selected, three of those menus walked the
whole selection for values they did not use or had already read:
- Make Opacity Mask's check sorted the selection into paint order for
its outermost objects before testing whether the selection has one
subject root, and it is enabled without that sort for any other
count. The check now sorts only for one root and no target.
- The Transparency menu built the panel's full values (opacity, blend
mode, isolation and knockout compared across the selection) to read
its first target. It now reads that target alone
(`Session::transparency_target`), and checks Make Opacity Mask only
when that object has no mask, the only case whose rows show it.
- The Color and Color Wheel menus asked the session whether the fill
and stroke differ, once in the Color menu and twice in the Color
Wheel menu. They now read the proxies' per-revision cache, which the
Tools panel's proxies fill on the same revision.
On a test document of 10,000 rectangles, all selected, one pass over
the panel menus' states took 24 to 31 ms before and 16.5 to 17 ms after
(release build, four passes each).
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 equality check that skips the undo step now sits in brush.options,
which compares the edited brush with the stored one. New, Delete, Move,
Duplicate and Replace Brush Art save the library as they do on main,
without decoding it a second time. docs/target-app-parity.md lists the
no-op rules for Brush Options and Apply Brush with their tests.
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.