A Color Replacement click, stroke or Shift+click segment adds one History
state named "Color Replacement Tool", as in the reference application.
The command's label is the same name, so a recorded action's step reads
the same as the History state.
The re-merge to main (9ac3fa22b) broke this test's premise. Main gained
`canvas_tool_menu::magnetic_drawing` (#11689): a right-click over a Magnetic
Lasso border in progress opens no menu, on the canvas and through the control
channel alike. So a menu can no longer be open over a live border, and the
test's right-click setup asserted behaviour that is now deliberately gone.
The `menu_dismiss_press` check on the hover block is therefore a guard rather
than a sequence a pointer can reach. The test stages the dismissal state
directly instead, with the button held: the flag is scoped to a held button (a
frame with every button up clears it), so a pointer-up frame would clear it
before the gate reads it and prove nothing. Holding the button also showed the
guard does suppress the hover, which the pointer-up version silently did not.
Two failures found while rebasing, both fixed here:
- the obsolete right-click setup (this commit);
- the pointer-up staging, which passed the flag only after the clear.
Main's Equalize change (58d11d91ea) moved Equalize to map_pixels_in, and this PR
moves Average off map_pixels, so after merging main the wrapper had no caller and
clippy -D warnings failed on dead code. Fold its doc into map_pixels_in.
Co-Authored-By: ArjenS-LA <ArjenS-LA@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
In a Lab document the Color mode no longer blends through RGB (which
changed the pixel's L): it keeps the stored L and moves a and b to the
foreground's, as in the reference application. Hue, Saturation and
Luminosity keep today's RGB blend.
Keeps main's Fade preview path in filter_preview.rs and passes the PR's
tool colours to the non-Fade preview; catalogs keep both sides' rows.
Co-Authored-By: Firstbober <firstbober@tutanota.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With the Background Eraser, the options-bar brush picker and a canvas
right-click open the reference application's compact popup instead of
the Brush Preset picker: Size, Hardness and Spacing with sliders, the
angle/roundness widget, Angle and Roundness, then the Size: and
Tolerance: pen dropdowns (Off, Pen Pressure, Stylus Wheel), the latter
with the tablet warning. No preset list or search field. Tolerance's
control is a tool option (Pen Pressure by default); Size's is the tool's
brush. Other tools keep the Brush Preset picker.
Holding Alt turns the Color Replacement tool into the Eyedropper, as in
the reference application: Alt+click and Alt+drag set the foreground
colour with the Eyedropper's settings, add no history state and change
no pixel, and the cursor shows the eyedropper. Ctrl+Alt keeps its
brush-resize meaning; a plain click still paints.
select.lasso takes an optional historyName; the Patch tool sends "Patch Tool" so its
lasso is that step (the Lasso tool keeps "Lasso"). paint.patch records "Patch Selection"
in every mode; the content-aware job keeps its progress text.
Tests: patch_history_names_tests (engine) and patch_tool_history_names_tests (ui-egui).
The standalone Spacing track had no accessible name or slider role,
unlike the slider_row it replaced. It is now a slider named "Spacing"
with the current percentage, as CodeRabbit noted.
Co-Authored-By: augrclk <augrclk@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A Brush press on a hidden target layer, a layer with Lock All, or a
group's pixels opens the reference application's alert with OK instead
of a status-bar message, and paints nothing. The texts name the tool
from one place (brush_refusal::tool_name); tools whose wording wasn't
measured keep today's status bar. A group's targeted mask and Lock
transparent pixels still paint.
A dab that erases a pixel only partly now also removes the sampled
colour's share from it: the kept colour becomes
(c - sampled x (1 - keep)) / keep per channel, clipped to the channel
range, so composited over the sampled colour it gives back the
original. Later dabs, in the same stroke and in later strokes, match
the pixel's current, decontaminated colour; sampling and the
Contiguous fill still read the pixels before the stroke. With the
graded alpha of #11901 this gives the reference application's drag
results.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fresh_brush gives the Background Eraser the reference application's
reset tip, a 13 px hard round at 25 % spacing with Size control off, as
it gives the Brush its own (#11810). Reset Tool, Reset All Tools and the
tool's first use all start from it; other tools and strokes without a
brush keep their tips.
The prompt for painting on a smart object reads "This smart object must
be rasterized before proceeding. Edit Contents will no longer be
available. Rasterize the smart object?", lower-case "smart object" as
measured. The 22 catalogs that translated the old text are re-keyed to
the new English text, so those languages keep a translation. The type,
shape and fill prompts are unchanged.
Raise the synthetic page to a million strokes so the 45 ms watcher
threshold keeps a wide margin on an optimised test build, and record why
the importer keeps one RenderCache per page.
The command is a job (inline under execute, a worker under start) that returns File > Open's result shape; the UI tracks it as an OpenTab so finish_open gives it the profile prompt (held, admitted with the smart object label) and after_open gives a raw the Camera Raw open dialog and the import warnings. Import options and the Color Settings policy match File > Open. The paths form is removed: the UI calls the command once per file.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium
- render_page: forward Interrupt to craft-pdf through an owned flag and a
scoped 5 ms watcher, so dense vector pages stop mid-render.
- Warn when craft-pdf reports a substituted font (the backend does not emit
the flag yet).
- /PageLabels: emit an entry for every page, start at 0, and write no tree
when every artboard name is empty.
- Export budget: charge retained page data plus the largest page's two f32
buffers instead of the whole document canvas, saturating on overflow.
- Render each artboard from a document holding only its group, so
overlapping boards no longer paint on each other's pages. One document
shell is cloned and reused.
- Tests: dense-page cancellation, labels with an empty middle name and all
empty, overlapping artboard pixels, sparse 9000x9000 canvas, seven US
Letter pages.
Find Edges used to give every pixel within the Tolerance full weight,
so on a blurred edge it erased more than Contiguous. It now uses the
same graded weight (#11901), which keeps the transition as the
reference application does and still gives the Contiguous result on a
hard edge.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Behind is one of the painting modes in the reference application: a
Shift+Alt letter or a Shift+minus/plus step that picks another mode (or
Clear) now also turns Behind off, in the same one tools.setBrush. With
Behind off the keys send what they did before.
One dab now erases a colour less the further it is from the sampled
colour, over the whole Tolerance, instead of fully up to the last
quarter of it. The weight is 1 - clamp((d - d0) / (T - d0), 0, 1) with
d0 = min(T / 20, 8 levels), measured with single clicks in the
reference application. The colour distance is the largest increase
plus the largest decrease over the channels, so opposite-sign changes
add up. Find Edges keeps its hard cut (#11904).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main made Coverage::new fallible (Coverage::try_new, finish -> Option, #4979);
the colour glyph Painter still called the old infallible API and its own
layer/clip buffers used vec! sized by the glyph window. Every buffer is now
reserved with try_reserve; a glyph that cannot be reserved makes the text
render nothing, as main does for its own passes, instead of aborting.
Co-Authored-By: adi-1108 <adi-1108@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Color Sampler menu kept only the sampler's index. If a control
command deleted an earlier sampler while the menu was open, the index
named another sampler and Delete removed that one. The menu now also
remembers the active document and the sampler's position; when either
no longer matches, Delete greys out and the menu closes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The smart object layer is built into the document before admission, so snapshot 0 holds it and the history is the single state "Open As Smart Object", as File > Open's is one state.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Model-Effort: Opus 5.5 drove; Fable 5.1 briefed; Sonnet 5.5 wrote at medium
Paragraph (box) text and vertical type are on the issue's *Not measured* list, whose rule is that
an unmeasured case keeps today's behaviour - and a coverage mask could not give back a box that
reflows or a column that stacks its lines, so their editable type layer stays. The commit converts
the measured case only: horizontal point text in an Indexed Color or a Bitmap document. The Type
Mask tools keep turning both into the selection, as they do today; there the user asked for one.
Also pin what happens when an edit that carries no coalesce key - the deliberately per-press
Alt+arrow kerning step - comes between the typing and the commit: the commit is a state of its own,
named for the type layer, exactly as the Type Mask commit and the plain layer's rename are in that
situation today. Nothing is mis-named; folding those states together would delete history the user
can undo today and belongs with #12039.
Tests: commits_as_selection across shape and orientation; the tool's commit of box and vertical text
in both modes; the split states and what each undo takes.
Scroll All Windows and Shift+drag moved the other shown views to the same
relative location in their own documents. The reference application moves
every window by the same distance in image pixels (a view at 100 % moves
twice the screen distance of one at 50 %), so follow() now takes the
dragged view's step in document pixels, measured between its clamped
centers when Overscroll is off. The checkbox gets the reference tooltip,
and new tests check that 100%, Fit Screen and Fill Screen still change only
the active view with the option on.
Co-Authored-By: dotCooCoo <1206598+dotCooCoo@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Main added a non-interactive RAW opener for Batch while #9991 was open. It refused a
sidecar whose crop keys were unsupported. #9991 moves those keys from the ignored list into
LoadReport::crop, so after the merge Batch would drop the crop without saying so. It now
passes the crop into RawTuning, as the interactive open does.
Co-Authored-By: ljkx <177671075+ljkx@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Two clicks on Brush Name and Brush Stroke in the same frame (assistive
technology or the control channel) both saw two parts on and turned
both off, leaving cards with no content. Count the parts on before each
checkbox so the last one stays on.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Leaving a length field without typing rewrote its value on focus loss: an
empty automatic Width turned from null into "", which made a named preset
such as "8 Columns" switch to Custom. The field now writes back only when
normalising changes the text shown.
Co-Authored-By: safvanedge <safvanedge@users.noreply.github.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>