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.
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.
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.
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.
With one object selected, the canvas highlights the objects Start Global
Edit would take. After every edit the engine reduced each candidate in
the document to its form again, measured its bounds twice, and made the
outline of each highlighted object again.
The forms, bounds and outlines are now kept by node between calls. An
edit replaces each node it changes, so after an edit only the replaced
nodes are measured again. Bounds of objects that hold symbol instances
are not kept. The outline pass finds each object, its selected ancestors
and its layer color in one walk down its index path.
The new test counts the forms and outlines made: 40 and 39 for the first
preview of 40 squares, then 1 and 0 after the selected square moves.
script.run's params text now says what app.undo() and app.redo() do. The artboardLayout messages,
their test and their catalog rows go back to main's text; they belong to file.new rather than to
script history.
main's item_rect now gives no bounds for an empty object, and the
Live Paint Bucket check became tool_paints for the fill and the
stroke. rotate and resize leave a path without bounds unchanged, and
appearance.setNewArt uses the same inheritance test as paint.rs.