Review follow-up. A pixel counts as selected exactly when the selection's
coverage8 stores it nonzero: the least such coverage is found once by
bisecting the f32 bits, so the scan stays one compare per pixel.
The scan no longer costs more than the select.lasso it replaces: strips
start at 64 rows and double up to about 4 MP, and each strip is checked
in parallel, branch-free blocks (sequential on wasm). A corner-to-corner
line on 7360 x 4912 now takes 25-32 ms (was 65-73 ms; select.lasso took
23-27 ms). A lasso that selects is still answered after the first strip.
Adds a test for a lasso over pixel centres with Anti-alias off.
Review follow-up. The check rasterizes the lasso as select.lasso does
(polygon_window over the canvas, kept from 1/255 as the selection stores
it) instead of a half-pixel area threshold. A tiny anti-aliased lasso that
covers part of a pixel selects it as before, and a thin lasso between
pixel centres without anti-aliasing now warns instead of adding an empty
Lasso step. Only the lasso's bounds are rasterized, 64 rows at a time,
stopping at the first selected pixel.
The Don't show again test now checks what reaches the preference store
and that a restart reads it back.
With no selection, a Content-Aware Move drag that encloses no area (a
click or a straight line) now opens the alert "No pixels are selected."
with OK and "Don't show again", instead of silently running select.lasso
on an empty polygon. No History state is added and nothing is selected.
A drag that encloses an area, a drag with a selection, and the Lasso tool
keep their behaviour.
"Don't show again" is a small reusable addition to the app's Error alert
(dialogs/dont_show_again.rs): the alert carries the dialog-preference key
it sets, and closing it with the box ticked keeps {"skip": true} there.
Fixes#12192
Only the sample match uses the measured increase-plus-decrease distance (#11901).
Protect Foreground Color keeps today's largest per-channel difference, as #11903
asks for its unmeasured cases. The tolerance doc describes the new distance and
the graded falloff.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Render each shape cache clipped to its own bounds instead of the full
page clip.
- Copy embedded font bytes before locking the shared text engine and take
the lock per font, not for the whole registration loop.
- Track seen font content keys in a HashSet instead of scanning the font
list for every glyph; hash glyph text for fake-bold pairing instead of
cloning strings.
- Update the module and `pdf-editable` feature docs to describe text and
accepted no-op clips.
- Poll the cancellation watcher every 20 ms; Device callbacks only cover
paints, so a single long path still needs the watcher.
The Type options bar always showed Left / Center / Right. As in the
reference application, for vertical text it now shows "Top align text",
"Center text" and "Bottom align text" with vertical glyphs: when the
edited or selected text layer is vertical, or with no text targeted
when the Vertical Type tool is active. The buttons still set left /
center / right and the lit one follows the targeted paragraph. The Type
Mask tools keep today's buttons (not measured).
The orientation is read from the target's own document, as the
paragraph style is, so a text edit left in a background document is
not judged by a same-id layer of the active one.
The three glyphs (vertical-align-{top,middle,bottom}.svg) are original
work drawn on Lucide's grid and stroke, with their ATTRIBUTION.md row;
they are kept out of the Lucide row's wildcard.
Cause: while a Patch or Content-Aware Move drag was under way, the cursor badge read the current modifiers, but the release and the paint read the modifiers from the press (`drag.modifiers`). Pressing Shift or Alt mid-drag after a plain press inside the selection flipped the arrow to Add or Subtract although the drag still moved the patch, and a drag pressed with Shift showed no badge once the key was let go.
Fix: `badge` takes the modifiers of the Patch or Content-Aware Move drag in progress, as the Lasso line below it already does. The tests now pin the arrow glyph's exact geometry (3 strokes, horizontal shaft, both barbs from the tip, mirrored ends), a drag started outside showing no arrow inside, Content-Aware Move staying badge-free, the press modifiers winning mid-drag, Shift+Alt giving Intersect on hover, and the Curvature Pen's real Move badge over an anchor.
Verified: `cargo test -p photocraft-ui-egui --lib patch_cursor` 10 passed (9 in patch_cursor_badge_tests plus the retouch_ui one), `retouch` 58 passed, clippy --all-targets -D warnings clean, fmt clean.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove and briefed; Sonnet 5.5 wrote at medium
Committing a Type Mask took the selection mode from the modifiers held
at that moment, so Shift added the text outline to the selection and
Alt subtracted it. As in the reference application, a commit now always
replaces the selection with the outline: a click outside the text, the
Commit button and Cmd+Return, with or without Shift or Alt.
type.createSelection keeps its "operation" parameter for scripts.
commit_with keeps its modifiers parameter so its callers don't change.
The #3036 canvas test keeps its check that the working text has no
Layers panel row; its Shift and Alt assertions now expect a replace.
Escape while typing with the Horizontal or Vertical Type Mask tool threw
the session away. As in the reference application it now commits: the
text outline becomes the selection in one history state and no layer is
added, whatever Preferences > Type "Use ESC to commit" says. The options
bar's Cancel still throws the session away.
Escape on an empty mask text, or while an input method is composing,
was not measured and still cancels. A Command transform drag keeps its
own Escape, and the Type tool's Escape still follows the preference.
The #1055 canvas test that pinned the old Escape now goes through
Cancel, which keeps what it guarded: the selection and layers unchanged.