A sliver at 0% opacity, or inside a group or layer at 0% opacity, paints
nothing, so Clean Up and Select > Object > Hairline Slivers now skip it.
The params text and docs/mcp.md say so, and docs/mcp.md also names what a
group or compound path used as a clipping path holds among the objects
both commands leave.
The params text and docs/mcp.md now say that a move by 0, 0 changes only
the anchors it makes corners, so a live shape whose listed anchors need no
change stays live, and one with an anchor made a corner becomes a plain
path.
selected_roots put the selected objects in paint order and dropped the
inner ones, two walks of the document, every time a command or an
enabled check asked. A rebuild of the menus asks many times for one
selection. The roots are now kept on the thread with the document
version (held weakly, so its address is not reused) and the selected
objects, and found again only when either changes.
With 10,000 rectangles selected, a menu rebuild after Select All went
from about 500 ms to about 340 ms on the build host.
The check that chooses between taking removed objects out of the
selection's paints and reading the selection again counted a type object
once, while taking it out reads one stroke weight per run. Deselecting a
type object of 10,000 runs beside two squares took 10,002 weights out
instead of reading the two squares again.
Reads now counts a type object once for each of its runs. A test in
large_edits.rs counts the stroke weights read or taken out; it fails
without the change (10,002 weights).
Follows #9930, which made the same check count the contents of groups.
With nothing selected, `paint.invert` and `paint.complement` recolored the
default fill or stroke before reading `target` and `aligned`, so a bad value
was accepted and changed the default. They now read both before the default
branch, as #8099 does for `paint.setFill` and `paint.setStroke`.
path.moveHandles with dx and dy of 0 only changes anchors that become
corners (both handles listed, or `independent`). It still passed every
listed handle on to the edit, so a live shape whose listed anchor needed
no change was expanded to a plain path. The listed anchors that need no
change are now left out, and the command returns without an edit when
none is left.
Follows #9921, which added path.moveHandles.
Main now reads the editing copy decoded as its streams are read
(#9922: ai_alone_decoded, ai_layers_alone_decoded, AiLayers::decoded)
and renamed the text document's patterns to paints (#9782:
text_patterns, Texts::with_paints). The decoded entry points take the
PDF part's widths as the ones they wrap did, AiLayers::decode goes
through AiLayers::decoded, and the text document still takes the widths
when it is first read, before its paints. The docs keep both sides'
entries.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
item_target now reads `target` with `ids` or `id` too, so the comment above the early read in
apply_paint_opacity names only the case it still covers: selected characters take the paint before
item_target runs.
item_target_at read `target` only when no `ids` or `id` was given, so paint.setFill and
paint.setStroke with an `id` and a target such as "content" painted the object instead of
refusing it, and tests::paintopacity::a_bad_target_is_refused_with_an_id_or_selected_characters
(added in #8099) failed. item_target_at now reads `target` first, for every command that names
its item through it, and the selected-part path no longer needs its own early read.
The opacity path of paint.setFill and paint.setStroke (apply_paint_opacity)
never checked `target` or `aligned`. With `id` or `ids` naming an object,
item_target reads no `target`, so a call such as {"opacity": 40,
"target": "content", "id": ...} painted the object instead of failing.
The test added in 6898eed99 covers that case, and the opacity path from
4f065ccbb (Show Opacity in the Color Wheel panel) merged beside it without
the check, so main's gate failed on
tests::paintopacity::a_bad_target_is_refused_with_an_id_or_selected_characters.
The opacity path now runs the same two checks as the color path
(tool_color_params): appearance::aligned and appearance::targets_contents.
Valid values are read where they were before.