This reverts commit bada8e1710. #7638 merged with its gate failing: besides six unformatted
files, render and trace don't compile against craft-libs e2dc681 (u64::from(usize) in
render/src/paint.rs, a private craft-libs function, and a call with one argument too many in
trace/src/opaque.rs), so main's CI fails. The tree is that of 0adbdce6cb, whose CI passed.
- `recolor.colors`, `recolor.reduce` and the recolor groups name the swatch of a color's first
linked use again. Only `color.used` takes its swatch and tint from the first linked use that is
not a gradient stop mixing a spot ink with process inks.
- A row wider than 128 chips asks `color.used` for as many colors as it holds.
- The new catalog rows sit with the other Color Wheel rows.
- Tests cover a click on a selected freeform point, the tint a click gives a selected gradient
stop, a row wider than 128 chips, and `recolor.colors` with a mixed stop painted before a plain
use linked to another swatch.
The Color Wheel panel menu gets Show Document Colors. It adds a row
under the wheel or the box with the colors of the selection, headed
Selection Colors, or with nothing selected the colors of the art Select
All takes, headed Document Colors, most used first and as many as fit
in one row. A color's tooltip gives its hex value and how many times
the art uses it. A click applies it to the active proxy or to the
selected gradient stop, keeping its color model and its link to a
global swatch, or to the selected freeform point, which takes the
color alone. Alt+click applies it to the other proxy.
The row keeps its colors during a drag. In art with more than 5,000
color uses, it reads them again at most once every half second after
an edit; a change of document or selection reads them at once.
color.used {selection?, limit?} lists the colors recolor.colors lists,
each with the color in its own model and the tint of its swatch to
three decimals. The swatch and tint come from the color's first linked
use in paint order, a plain use before a gradient stop that mixes a
spot ink with process inks; a color that only such stops link has no
swatch there. ui.colorWheel {documentColors} sets the option, which is
kept with the preferences.
Docs: docs/control-protocol.md, docs/mcp.md, docs/target-app-parity.md.
A trace handed in for imageTrace.make or imageTrace.makeAndExpand was
matched by its object, image, pixels and settings alone, so a trace made
in one document could stand in for the command in another open document
with the same image and settings. The trace's inputs now carry the
document's uid: TraceRun::current is false in any other document, and the
commands there drop the trace handed in and trace their own image, as one
undo step.
Test: a_trace_run_applies_only_in_its_own_document.
Document::symbol_art_bounds measured a symbol's art without the
document, so an instance of another symbol in that art counted as the
20 x 20 square. It now measures the art through SymbolBoxes, so a nested
instance takes its own symbol's art, and an inline graphic of the outer
symbol is sized by it and follows it when that symbol changes.
- The inline resolve order also follows the instances that size a
symbol's art, so a symbol is measured after the type in the art of
the symbols it holds is laid out again.
- A symbol whose art reaches itself through an instance and an inline
graphic is an empty slot. Only instances that the measurement uses
count, so one a clipping path hides adds no dependency.
- A missing symbol, a symbol without art, a symbol that holds an
instance of itself, and nesting 32 deep still measure as the square.
- SymbolBoxes finds symbols through a name index built once, and the
inline resolve pass and inline_art_bounds share one index, instead
of scanning the symbol list for each lookup.