layer.new without `top` or `below` now reads the drawing mode: in Draw
Behind the new layer goes directly below the current layer, at its level
(a sibling below a current sublayer), as the help page describes
(https://help.adobe.com/archive/en_US/illustrator/cs5/illustrator_cs5_help.pdf#page=234).
The Layers panel button, the panel menu, Ctrl/Cmd+L and the Layer
Options dialog all go through layer.new. `top` and `below` keep their
meaning in every mode, Draw Normal and Draw Inside keep a new layer
above the current one, and New Sublayer is not affected.
Cut with direct-selected anchors or segments removed each object selected
whole, and each path it left with no segment, with its own remove. Every
removal shifted the siblings after it, so later lookups walked the
document's tree again. With 2,000 roots removed whole, the old loop
walked the tree 10,005 times.
These removals now go through the same batch that already places the
surviving pieces, which rebuilds the children of each layer or group
once, and compound paths left with no members are removed after it. A
compound path left with one member stays a compound path. The document,
the selection, the clipboard and the undo step are the same as before.
With 2,000 of 10,000 squares on one layer selected whole and two anchors
of another picked, Cut walks the tree 8 times instead of 10,005 and
takes a median of 11 ms of CPU time instead of 573 ms (release build on
Linux, seven alternating runs in one process).
Session::execute asked about a command's params description several
times per command (the key check, whether `id` stands for `ids`, whether
it takes `ids`), and each question parsed the description again, with a
command lookup for each word after the first of each `…` entry. The
engine now reads every built-in description, and the ones its `…`
entries name, once into a table keyed by the description's address and
length, and answers accepted_keys, takes_key, id_stands_for_ids and
check_keys from it.
A plug-in command's description, and a built-in description whose `…`
entries name a plug-in command, are still parsed where they are used,
since plug-ins change while the app runs. The keys, answers and error
messages are the same; tests::params_cache compares them for every
built-in command against a fresh parse.
In a release build on a one-object document, object.move with ids and
dx takes 48 us of thread CPU time per command instead of 61 us, and
select.set with ids 2.3 us instead of 3.2 us (medians of 7 alternating
runs of 20,000 commands in one process, while other builds were running;
tests::params_cache::bench_params_keys_once). The time is saved per
command, in scripts, batches and MCP or plug-in call loops, and does not
grow with the size of the document.
When a New Document profile's Default Graphic Style differs from the shipped
one (white fill, 1 pt black stroke), file.new resets new art in documents
from that profile to the style's fills, strokes and effects, not linked to
the style. Default Fill and Stroke (paint.default, D) gives the defaults and
the selected art the same look in those documents; type still gets a black
fill and no stroke. A profile with the shipped style leaves the current fill
and stroke as they were.
Part of #8350
Running Locate Object or Locate Layer again on the row it already
highlighted wrote the same highlight, so the Layers panel did not open
the layers around the row or scroll to it: a sublayer whose layer was
closed since stayed hidden. layer.locate now leaves a one-time request
on the document (DocState::locate_reveal) that the panel takes on its
next frame, opening the layers around the located row and scrolling to
it whether or not the highlight changed. The request is not saved and
adds no undo step, and the panel drops it when the row is no longer
highlighted.
DXF export with Use Artboards baked the whole document's live effects
and placed symbol art again for every artboard. export_drawings now
checks the options and every region, bakes once, and writes each
drawing from the same baked document. export calls it with one drawing,
and the encoder makes one call for all the chosen artboards. Each
drawing's bytes, linked images, warnings and setting notes are the same
as before; the tests compare them with drawings baked one at a time.