AreaShape::spans folded each Combine/Join component into the growing
interval list with a full merge, so a shape of many disjoint components
cost components x intervals per row, repeated for every row the layout
tries. Gather a run of union components' intervals and merge them once
(sort and sweep) when the run ends; other operators fold as before.
The rasterizer found each glyph's colour with a linear search of the
colours seen so far, then walked every glyph and decoration twice per
colour (bounds, then coverage) to draw that colour's items. A text layer
with a colour per letter cost colours x glyphs before drawing anything.
Build each colour's glyph and decoration lists in one pass, keyed by the
colour's bits, and draw each pass from its own lists.
The key now uses the brightness and contrast values Texture::level uses (clamped, non-finite as 0, -0.0 as 0.0), so equal levels share one entry. The cache logic moves into a PatternCache struct so the eviction test runs on its own instance instead of the shared static.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Review: with `selected` taken off a Gradient Overlay page and back to the same instance during a
held press (a control client's `ui.dialog.set`, say), `drag_gradient` didn't run meanwhile and the
origin and baseline from before stayed, so the next move added the travel made while off the page
and the gradient jumped. The canvas ends the stored drag (`layer_style::end_gradient_drag`)
whenever its gradient branch is inactive on a Layer Style dialog; the page chosen again starts
from the offset shown.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Layout looked up each paragraph's style with a reverse scan of every
paragraph start, tab placement re-checked the whole rest of the line for
every cluster, and PSD import found each character run's paragraph by
summing paragraph lengths from the first one. Each was quadratic in
counts a file controls.
Use the existing binary search over run starts for paragraphs, one
reverse scan for the line's last inked slot, and precomputed paragraph
ends with a binary search on import.
Review: Mac Roman "90°" alone has no ASCII letter, so its one windows-1251 letter made the name
"mostly Cyrillic" and the fallback showed "90Ў"; "¡Ánimo!" counted nothing for windows-1252 since
only ASCII letters were counted after ¡; and Mac Roman "20 °Celsius" tied with windows-1252
"20 ¡Celsius". A lone Cyrillic letter right after a digit never counts (a run after a digit, "5шт",
still does); the letters after a character include accented ones; and ¡ counts where it opens an
exclamation, two letters or more after it and the closing "!" later in the name, which the degree
sign before a unit never has.
Re-lands 47ee3f696, which went out under another PR's message by mistake and is reverted just
before this, with one test case less: without any hint a lone Mac Roman degree sign before an ASCII
letter is also a Big5 punctuation pair, a tie the fallback flags, so the Mac Roman cases keep their
Latin hints.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review: an empty layer gave bounds of 0 x 0, so the canvas took the drag from the Hand tool and
wrote offsets of up to ±4 layer widths from a short drag, for a gradient that paints nothing;
and the drag's one origin stayed when `selected` changed under a held press, so the next instance
moved from the previous origin and the whole travel since the press. `gradient_layer_bounds`
returns `None` for empty bounds, and `__gradientDrag` keeps the instance id, the origin and the
pointer total at that point, taken afresh when the id differs: offsets are the origin plus the
travel since.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review: an empty layer gave bounds of 0 x 0, so the canvas took the drag from the Hand tool and
wrote offsets of up to ±4 layer widths from a short drag, for a gradient that paints nothing;
and the drag's one origin stayed when `selected` changed under a held press, so the next instance
moved from the previous origin and the whole travel since the press. `gradient_layer_bounds`
returns `None` for empty bounds, and `__gradientDrag` keeps the instance id, the origin and the
pointer total at that point, taken afresh when the id differs: offsets are the origin plus the
travel since.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A pixel layer whose default pixel is opaque covers the canvas without
stored tiles, so it is not Empty. The empty layers are now found once
per document revision (Filter::of_app, like Smart Object's missing
links) instead of reading every pixel of an erased layer on each
repaint of the Layers panel.
CodeRabbit review points: a duplicate insert should promote the entry, the key-separation test could pass after the base entry was evicted, and the entry limit was untested.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
CodeRabbit review points: the i32 rem_euclid in sample_bilinear_wrap differs from sample_wrap for sides past i32::MAX, and nothing checked the x/y argument order at the texture_at call.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The reference application's Info panel shows the crop frame's W and H but no
ratio line, so it stays out for now; W and H keep following the frame.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Measured in the reference application: after ↵ commits a crop, the Crop
tool shows no frame; pressing C again, or another tool and back, keeps it
hidden, and only a press on the canvas brings the frame back. A crop
committed by leaving the tool is different: back on the Crop tool the idle
frame shows at once. #10642 brought the frame back on re-picking; picking
the tool no longer ends the hidden state, and a commit on leaving the tool
does not start it. Tests follow.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: `drag_gradient` ignored a stored `offset` of three elements or more, which the engine
renders by its first two, so the first movement jumped the gradient; and `gradient_drag` took the
Hand tool over on the page kind alone, so with the dialog's layer gone the canvas neither panned
nor moved anything. The drag reads the first two elements as the engine does, and the layer
lookup is `layer_style::gradient_layer_bounds`, used by the decision and by the drag alike.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Review: "šuma" (0x9A u m a) read as Mac Roman "öuma", certain, where main tied it and read
windows-1252; and "¡Hola!" read as Mac Roman "°Hola!". The word-initial rule for windows-1252's
0x80–0x9F letters no longer asks for a capital (the file's own alphabet still decides: a file that
writes ö and never š reads the byte as Mac Roman ö), and ¡ counts as common text for windows-1252
where it opens a word of two letters or more (`opens_word`, in `score` and in the final
windows-1252/Mac Roman comparison), while Mac Roman's degree sign on the same byte, after a
number ("Rotation 90°") or before a single letter ("20 °C"), stays as it was.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Main's #10905 (#10867) turns the Background into Layer 0 when a crop keeps
the cropped pixels, so the corners a turn uncovers stay transparent instead
of taking the background colour. The #10950 test now expects that for its
Delete Cropped Pixels off cases; with it on the corners are still the
background colour.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up on the Image Assets PR: the notice title carries the full saved path so same-named documents in different folders stay distinguishable, and the status line keeps the success count and assets folder alongside the first failure.