A layer is listed only once 2% of the pixels it owns differ, so a few
stray pixels on a large background give `total` 0, and changedPercent,
rounded to one decimal, reads 0 for them. The docs said a clean result
meant no compared pixel differed by more than the tolerance; they now
give the 2% rule and what it leaves out, and the compare_design
description says an empty list doesn't mean every pixel matches.
The example now passes the frame's `id`; a clean result is described as covering only the area
compared and the layers looked at; `truncated.matchedByBox` is explained. The test of the
differences cap asserts that the list is shorter than the count rather than the cap's value, and
uses a small frame (it took several seconds).
`inspect.compare` checked only how many targets it had and that the target had a size, so with a
rectangle selected it compared the page against the rectangle, used the rectangle as the viewport,
and returned a result that looked like a real answer. A page is built from a frame, a component or
an instance of one: any other layer, named outright or selected, is now refused before the capture
is read, with what it is and what to pick. The command's and the tool's descriptions and the docs
say so.
An agent building a page can't see whether it matches the design. `inspect.compare` and the MCP
tool `compare_design` take a capture the agent's own browser tools made and compare it with a
frame, on this computer. A browser's text and antialiasing never match pixel for pixel, so the
answer isn't one score: it is the layers that differ, each on the deepest layer it belongs to and
largest first, as a position difference (with its offset), a colour difference (expected and
actual) or a content difference. Text is held to twice the tolerance. A capture at 2x is the same
design: the frame's width sets the density.
Explicit targets are validated, and one frame is compared at a time. Parameters of the wrong type
are refused, and so are a path and data together. The capture is size-checked before it is
decoded, the comparison scale is bounded by the larger of the frame and the capture, the layer walk
is iterative and capped (`truncated` says so), and only the 100 differences listed are searched
for a move.
Image fills were dropped by the native targets, so a photo under a colour overlay vanished (#2271). Each image fill is now written in its paint-order place as the asset file.exportAssets hands over, named by the same content hash, fitted by its scale mode with its opacity. A pattern fill is left out with a comment line.
While the Pencil, Marker or Highlighter is the tool, a bar above the
bottom toolbar shows its ink: eight colours (the Pencil also its
automatic black, or white on a dark page or frame), any colour through
the colour picker, and the stroke weight. Each tool keeps its own for
the session; new strokes and the Pencil's preview take it.
tool.ink {tool?, color?, weight?} sets and reads it, and board.ink
takes a weight.
A sharp drop shadow under a stroked layer (text with an outside stroke most visibly) showed a light outline along the layer's edge wherever that edge lay over the shadow. Hiding the shadow behind the layer cut the layer's share of each anti-aliased edge pixel out of the shadow, then the layer's edge pixel drew that share again: the edge counted twice. The shadow now keeps its part outside the layer scaled by what the layer lets through there, the outlines it is cast from and hidden behind follow what the layer fills (#2635), and stroked text casts and hides its shadows by its outlines too (#2631).