Commit Graph
3891 Commits
Author SHA1 Message Date
Perchenko AntonandBrandon Thomas f3941972df fix(actions): preserve scalar Selective Color settings in ATN export (#7681)
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-23 18:34:54 -04:00
David Mann 9c5a7b907a Merge remote-tracking branch 'origin/main' into integration-batch-7
# Conflicts:
#	crates/ui-egui/src/i18n/tr.tsv
#	docs/ui-parity.md
2026-10-24 00:34:11 +02:00
David MannandClaude Opus 5.5 f38004e721 Address CodeRabbit review: an opacity-only style preset added with ⇧ sets the opacity (#4049)
`style.presets.new` with `includeBlending: false` and an explicit `opacity` stores only that
opacity, but `apply` with `add: true` skipped the blending block unless the preset had a blend
mode, so the layer kept its opacity. Test: an_opacity_only_style_added_sets_just_the_opacity
(also checks the layer's blend mode and Fill stay).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-24 00:23:15 +02:00
David Mann 8c04b175ec Merge remote-tracking branch 'origin/main' into integration-batch-7
# Conflicts:
#	crates/automation/src/rpc.rs
#	crates/automation/src/server.rs
#	crates/gpu/src/health.rs
#	crates/text/src/tests.rs
#	crates/ui-egui/src/i18n/zh-hans.tsv
#	crates/ui-egui/src/panels.rs
#	docs/control-protocol.md
#	docs/ui-parity.md
2026-10-24 00:23:15 +02:00
Finn Newick e43f7dbacc Merge remote-tracking branch 'origin/main' into fix/align-shape-bounds 2026-10-23 23:07:52 +01:00
Finn NewickandClaude Opus 5.5 390793f926 fix(align): measure shapes' full extent only for Align and Distribute
layer_bounds goes back to the cached render's bounds, so the layer list,
copy and artboard paths don't re-render shapes. Align and Distribute use
align_bounds, which measures a shape's own extent off the canvas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 23:07:52 +01:00
fc0b40dae5 fix(atn): keep Photoshop's other transform interpolation modes on import (#8698)
The .atn importer kept only bicubic, bilinear and nearest from a
transform's Intr, so a recorded Bicubic Automatic, Sharper or Smoother
Transform Selection replayed with the command's default (bilinear) and
re-exported without its choice. The bicubic variants are now kept (the
transforms already render them as Bicubic), Automatic becomes Bicubic
Automatic and Preserve Details Bicubic, and both transform commands list
the variants (#8697).

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-23 17:55:54 -04:00
5750ed40f9 Fix pasted shape group bounds and effects across documents (#8992)
* fix(clipboard): render copied shapes in destination canvas space

When a copied shape group is placed beyond its source canvas, rebuild its vector caches against the destination canvas and pixel format. Previously a centered paste into a larger document could clip the caches to an empty source-sized frame, leaving no transform bounds and incorrect effects until a point edit refreshed each shape.

Restore missing shape caches and refresh source-clipped caches when canvas dimensions change. Cover Paste and Copy to Document, nested group contents, 8/16-bit destinations, rendered cache equality, transform bounds and movement Undo.

* fix(clipboard): measure shape placement before destination clipping

Restore missing source-space shape caches before measuring copy bounds, then adapt and translate for the destination. Re-render empty caches when shapes move back onto the canvas instead of shifting an empty raster.

Add focused integration coverage for 32 combinations of partial and full destination clipping, grouped shapes, missing caches, 8/16-bit output, centered and point placement, and Undo/Redo. Clippy and WASM checks pass.

---------

Co-authored-by: kotulsky <7805437+kotulsky@users.noreply.github.com>
Co-authored-by: Brandon Thomas <echelon@gmail.com>
2026-10-23 17:54:26 -04:00
JGF 35cb32be20 fix(export): report skipped layers in doc_export_layers (#8491) (#8713)
* fix(export): report skipped layers across automation surfaces

* test(export): use the MCP visible_only parameter spelling

* test(export): restore old adapter for hosted regression proof

* Revert "test(export): restore old adapter for hosted regression proof"

This reverts commit 397a5ffa2a.

* docs(export): qualify workspace-only response guarantees
2026-10-23 17:41:19 -04:00
Zuujis 4bda8d7388 test(panic_hunt): give the panic-counting self-test its own deadline (#8473)
contained_panics_count_and_graceful_errors_do_not used the 4 s hang
budget meant for fuzzed commands. With RUST_BACKTRACE=1 the panic hook
prints a backtrace, and on loaded Windows runners the first symbol
lookup took long enough (19.6 s) that run_watched returned None instead
of Some(false). The self-test now waits up to 120 s; the fuzz keeps 4 s.
2026-10-23 17:40:32 -04:00
NetterSilverandClaude Opus 5.5 03dd76022b Reject non-hex characters in engine hex color parser (#8541)
Found while testing crates/engine/src/commands.rs:283-291 (parse_hex)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:40:27 -04:00
Gabriel Luís da Silva 7bc6fd8a4f Write the Levels and Curves composite channel as Chnl.Cmps in .atn export (#8686)
Photoshop records the composite entry of a Levels or Curves Set as
Chnl/Chnl/Cmps and silently leaves the adjustment unchanged when it is
Chnl/Ordn/Trgt, which is what the export wrote. Import already reads both.

Fixes #8543
2026-10-23 17:40:11 -04:00
FinnNkandClaude Opus 5.5 159fe710a2 feat(guides): New Guide Layout takes lengths with units (#8719)
* feat(guides): New Guide Layout takes lengths with units

view.newGuideLayout took pixels only. Its widths, gutters and margins now
also take text with a unit as typed in Photoshop's dialog ("1 cm",
"0.25in", "12 pt", "3pc", "10%"), at the document's resolution; percent
is of the target's width for columns, gutters and left/right margins and
of its height for rows and top/bottom margins, per artboard. The dialog's
Width and Height fields already pass such text through, so they accept
units now too.

Part of #4984

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(guides): New Guide Layout percent resolves per selected artboard

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(guides): assert the full guide lists after a selected-artboard layout

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:40:06 -04:00
FinnNkandClaude Opus 5.5 0986582a61 fix(actions): a recorded Layers-panel drag keeps its drop target by name (#8781)
* fix(actions): a recorded Layers-panel drag keeps its drop target by name

Dragging a layer while recording stored layer.moveTo's target as a layer
id, which means nothing in the document the action later plays in, so
playback stopped with "no such layer". The target is now recorded by
name (with targetOccurrence among same-named layers), as layer.select
records its layer, and layer.moveTo accepts a target by name.

Fixes #7845

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(actions): count a drag's same-named targets without the moved layer

Steps are recorded after they run, so a target's occurrence among
same-named layers could shift when the moved layer shares its name. It
is now counted among the other layers only, at recording and at replay,
which the move doesn't reorder. Only a drag of the selected layer is
recorded by name; drags of several layers, or of an unselected one, keep
their ids.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(actions): a moved group's contents don't count as drop targets

Same-named layers inside a moved group also changed order with the
move, so they are left out of the occurrence count with the group.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(actions): leave every moved layer out of a named drop target

A move of several layers given a target by name no longer counts the
moved layers (or their contents) as candidates.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(actions): a recorded ⌥-drag copy beside itself replays by name

A copy leaves its source in place, so the source stays a candidate for
the named target, at recording and at replay.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(actions): a recorded copy's own contents don't count as drop targets

The step is recorded after the copy exists; the copy (and, for a group,
its same-named contents) is left out of the occurrence count, as at
replay it doesn't exist yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:39:45 -04:00
ZFzuofeng 13e4d8ceed fix(engine): select files correctly in Windows Explorer (#8518) 2026-10-23 17:39:08 -04:00
FinnNkandClaude Opus 5.5 51e45fd394 fix(engine): refuse partial Color Balance and Hue/Saturation ATN exports (#8701)
* fix(engine): refuse partial Color Balance and Hue/Saturation ATN exports

A `layer.setAdjustment` step changes only the settings it names, but the
Color Balance and Hue/Saturation descriptors written to the ATN carry
every setting and filled absent ones with defaults, so a partial edit
replayed as one that also reset the rest. Strict export now refuses such
a step (with skipUnsupported it is listed in Skipped); complete ones
export and round-trip as before.

Fixes #8531

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(engine): refuse Hue/Saturation ranges missing their own settings

A colour range written without its own hue, saturation and lightness
would replay with the missing ones reset to 0, so strict export refuses
it like a partial master setting.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(engine): refuse wrong-shaped Color Balance and Hue/Saturation settings

Strict export now checks the triplets, numbers and flags it needs are of
the shape the descriptor writer reads, since it would write anything else
as 0.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(engine): refuse malformed Hue/Saturation range bounds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* test(engine): cover malformed and valid Hue/Saturation range bounds

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(engine): refuse fractional Hue/Saturation range bounds

The descriptor stores them as integers, so a fractional bound would be
rounded on export.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:38:48 -04:00
FinnNkandClaude Opus 5.5 272554f971 fix(type): type.edit with new text keeps the styles of unchanged text (#8766)
* fix(type): type.edit with new text keeps the styles of unchanged text

`type.edit {"text"}` replaced the whole string, so every character took
the first run's style and other styled ranges were lost. It now replaces
only the span that differs (after the common prefix and suffix), so the
unchanged text keeps its character and paragraph styles and an added
character takes the style beside it, as the params doc promised.

Fixes #8489

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* fix(type): text inserted at a paragraph's start joins that paragraph

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 17:38:36 -04:00
David Mann 27caf2823b Merge remote-tracking branch 'origin/main' into integration-batch-7
# Conflicts:
#	crates/engine/Cargo.toml
2026-10-23 23:13:46 +02:00
Dylan M. Taylor 6d4b9690ab deps: roxmltree 0.21 in photocraft-io and photocraft-engine (#8973) 2026-10-23 17:06:29 -04:00
aiongg 7aaa59712a Merge main into integration-batch-7 2026-10-23 20:37:05 +00:00
Jeremy YaoandClaude Opus 5.5 9232f2da4d Merge branch 'main' into feature/animation-effects
Brings in 72 commits from main (bde13687). Two conflicts:
- apps/photocraft-web/Cargo.toml: main added the web-sys RequestMode feature;
  the list is main's plus this branch's MediaQueryList.
- crates/ui-egui/src/prefs_ui.rs: main deleted the translation-coverage test
  preference_labels_are_translated (c3aa3f9e, missing translations are now
  reported by xtask ci); this branch had only adjusted it, so it goes.

docs/scorecard.md is regenerated; it differs from main only in UI-217-10.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 16:23:55 -04:00
midasdf 7d997905df Merge remote-tracking branch 'origin/main' into jp/print-paper-sizes 2026-10-24 04:05:41 +09:00
Hartmut NörenbergandClaude Opus 5.5 b0b100643b fix: waiting Remove strokes keep the brush they were drawn with (#8923 review)
A waiting stroke (Remove after each stroke off) was tinted with the brush it
was drawn with but removed with the brush at ↩, so changing the brush in
between made the tint and the removal disagree.

- `paint.remove`: a `strokes` entry may be `{"points", "size"?, "hardness"?,
  "spacing"?}`, which override the call's for that stroke; a plain point
  list still takes the call's.
- The UI keeps each waiting stroke as such an entry with the brush it was
  drawn with; its tint (`stroke_brush` of it) and its removal both use it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 20:54:19 +02:00
aiongg cf0960b520 Merge pull request #8915 from aiongg/ci-speed-2
CI: no debug info for dependencies, nextest in xtask ci, long sweeps spread over days
2026-10-23 13:48:36 -04:00
Finn NewickandClaude Opus 5.5 603c5ac5b0 feat(algo): describe the Gaussian blur as data for other devices
Separable (an exact kernel, or box widths) is the blur Gaussian Blur
runs, taken from blur.rs's own functions; the CPU Gaussian is now built
from it, so a GPU operator running the same description can't drift.
OperatorRegion says which source pixels an output area reads, and
edge_extent is the edge-repeat extent the engine already used for layer
filters (now shared). Tests pin the reach to the CPU's real output and
check an output depends only on its input region.

Part of #5772 (Phase 1, step 1.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:24:15 +01:00
MarekSpodBiedry 148e87944a Raise the Define Pattern size cap from 4000 to 8000 px per edge (#8820) 2026-10-23 17:31:29 +02:00
Finn NewickandClaude Opus 5.5 ee5d556014 fix(actions): keep out-of-range Camera Raw values as Photoshop steps
A recorded Camera Raw Filter value outside its slider's range (exposure
past +/-5, negative sharpening, ...) was imported and then clamped on
playback. It now leaves the step as a Photoshop step, using the PSD
mapping's ranges.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:25:06 +01:00
Finn NewickandClaude Opus 5.5 bbe7659ac3 fix(actions): refuse unreadable Camera Raw values, bad splits and curves
A recorded Camera Raw Filter step now stays a Photoshop step when a
value it records is not a number, when its curve splits are outside
0..=100 or out of order, or when a point curve is one that
filter.cameraRaw refuses (validate_curve), instead of replaying a
different look or failing on playback.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 15:05:23 +01:00
John Turnbach d5f561190b docs(atn): document adjustment_by_class 2026-10-23 09:59:42 -04:00
John Turnbach e6a3a4d511 fix(atn): import Photoshop's string class for Vibrance adjustment Sets
Photoshop's Properties panel records an edit of an existing Vibrance
layer with the class string id `vibrance`, not the `Vbrn` code the
adjustment table knows, so the whole Set imported as an unsupported
Photoshop step and stopped playback. Map the string class to the same
adjustment.

Fixes #8534
2026-10-23 09:59:42 -04:00
Dylan M. TaylorandCodebuff f27656b910 fix: restrict droplet shim permissions and annotate test range (SonarCloud) (#8870)
The generated droplet shim only needs to run as its creator, so 0700 keeps
other local accounts from reading the CLI path it invokes. The reversed
range in the arrow-key test is the case under test, not an accident.

🤖 Generated with Codebuff

Co-authored-by: Codebuff <noreply@codebuff.com>
2026-10-23 09:57:10 -04:00
Finn Newick 49e0c6dcd9 Merge remote-tracking branch 'origin/main' into feat/atn-camera-raw
# Conflicts:
#	crates/engine/src/atn_cmds.rs
2026-10-23 14:55:27 +01:00
midasdf 1779e69c7d Merge remote-tracking branch 'origin/main' into jp/print-paper-sizes 2026-10-23 21:01:23 +09:00
xwizeandClaude Opus 5.5 68ca48ddeb Indexed Color: Pencil Auto Erase compares against the painted colour
Review follow-up. In an Indexed document an off-table foreground paints as
its nearest table entry. Auto Erase still compared the stroke's start pixel
with the raw foreground, so a second stroke that started on what the first
one painted never switched to the background colour. Both the commit and
the live preview now compare against the foreground as the table paints it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:46:57 +01:00
xwizeandClaude Opus 5.5 d73604860e Indexed Color: remap only the pixels a stroke changed, a tile at a time
Review follow-up. The palette step quantised the whole stroke damage
rectangle as one dense buffer. A long diagonal stroke on a large canvas has
a rectangle near the size of the document, so this allocated about 28 bytes
per pixel of it. It also remapped pixels inside that rectangle the brush
never touched, which can already be off the table (Paint Bucket doesn't
snap yet).

keep_in_color_table now walks the rectangle tile by tile and maps only the
pixels that differ from the surface before the stroke (a cheap clone: tiles
are shared until written). The live preview compares against its own
pre-stroke surface the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:33:48 +01:00
xwizeandClaude Opus 5.5 e22984536c Indexed Color: keep Brush strokes inside the colour table
An Indexed Color document keeps its pixels expanded to RGB with the palette
as side data, and the Brush rendered straight onto that surface. A red
stroke on a black/white document therefore left opaque red pixels, and soft
edges or partial opacity left blends, all outside the colour table, while the
document still reported Indexed mode. Photoshop (and GIMP, which documents
it) paint the nearest table colour instead.

The stroke commit now maps the damaged rectangle to the nearest table entry
with the same no-dither quantiser the Indexed Color conversion uses. That
keeps the table's transparent entry binary as well. The live preview
applies the same step, so the canvas shows the pixels the commit keeps.
This covers paint.stroke and paint.pencil, including erasing. Masks and
channels are gray targets and are left alone.

Fixes #8669

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:18:30 +01:00
Khawar Zamman WaniandClaude Opus 5.5 f58e2f4275 fix(algo,engine): refuse a Select and Mask refine too large to allocate
refine_mask_with builds its result densely over the selection's bounds
(grown by the spread, plus Refine Edge Brush additions). After a thin
edit across a huge canvas, or with a whole-canvas selection there, that
is billions of pixels. matting::refine_area names that area and
select.refineEdge refuses one over MAX_REFINE_AREA (2^30 px) with an
error before allocating, leaving the selection unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FszacAJDjznVimaxQktoJT
2026-10-23 14:41:20 +05:30
Khawar Zamman WaniandClaude Opus 5.5 56bbe6b80b fix(algo,engine): paint Select and Mask Brush, Lasso and Refine Edge Brush tile by tile
The Brush edit, the Lasso edit and EdgeBrush::new allocated a dense buffer
over their bounding box, which the swept-area cap does not bound: a 1 px
diagonal across a 100,000 px canvas sweeps ~141k px but asked for ~40 GB.

- matting::brush_surface (replaces brush_region) and EdgeBrush paint only
  the tiles a stroke touches (painted_tiles), capped at MAX_PAINTED_TILES.
- selection::polygon_surface rasterises only the tiles the Lasso's edges
  cross, byte-identical to selection::polygon; interior tiles share one.
- selection::combine_sparse adds/subtracts visiting only the new shape's
  tiles, keeping the rest of the selection shared.
- select.refineEdge refuses edits and refineStrokes that would cross too
  many tiles before painting anything, leaving the selection unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FszacAJDjznVimaxQktoJT
2026-10-23 14:22:33 +05:30
aiongg 18f4b5348c Tests: spread three format-by-geometry matrices over the days, and build one precheck state per case
The tilt-shift reference tests and tiled_clear_and_fill_match_one_pass_over_the_area cross pixel
formats or channel counts with independent geometry and fill settings. Each run takes a quarter of
the combinations through Sweep, a different quarter each UTC day.

precheck_agrees_with_execute built all five document states for every call and kept one; it now
builds only the state the call needs.
2026-10-23 08:30:48 +00:00
D-monizedandClaude Opus 5.5 0056b44a6f Merge origin/main into feature/font-recent-favorites
main now has its own Recent Fonts (#3559), so this branch drops its separate
recent list (prefs `recentFontList`, `type.font.noteRecent`, `type.font.clearRecent`,
the five-font cap) and its font menu uses main's: the list is
`PhotocraftApp::note_recent_font`'s, the rows and arrow keys main's `font_menu_rows`,
and every applied family is recorded, as main does. Favourites, the class and
similar/variable filters, the style expander, format badges and the live preview
stay. Faux Bold keeps the one-pass thickened outline on main's fallible coverage
buffers (#6001), budgeted as a plain pass. Both sides' strings and icon credits are kept;
the scorecard is regenerated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 02:28:05 -06:00
Gert Pellin 7c180529d6 Layers: a new fill or adjustment layer drops the selection it took as mask (#8801)
A new fill or adjustment layer made while something is selected takes the
selection as its layer mask (#1250). In Photoshop the marching ants are then
gone, as after Reveal Selection, which drops the selection since #5251.
PhotoCraft kept it, so the next pixel edit on another layer (Duplicate,
Desaturate, Levels…) only touched the area inside the old selection.

mask_new_layer now clears the selection when it became the layer mask, in
the same history step: one undo removes the layer and brings the selection
back. A path used as vector mask leaves the selection alone, and so does the
Gradient tool's fill layer.

Tests: new_adjustment_and_fill_layers_are_masked_by_the_selection asserts the
selection is gone and comes back on undo, and the new
an_edit_after_a_new_fill_layer_on_a_selection_reaches_the_whole_layer covers
the duplicate-and-desaturate case (both fail on main). Tests that deselected
right after a new fill layer no longer need to; tests that need a selection
after one select again.
2026-10-23 10:05:10 +02:00
Gert Pellin e923de0ff8 CLI: run and batch skip Deselect with nothing selected, as playback does (#8802)
Action playback treats Deselect with nothing selected as a silent no-op
since #6744, as Photoshop does. photocraft-cli runs its --cmd list and
batch steps one by one through command_run, so a Deselect after Reveal
Selection (which drops the selection since #5251) stopped the whole run
with "no selection" and wrote no output.

run and batch now use the same check as playback (actions_cmds::noop_step,
now public). run still prints a result line for the skipped step. A single
Deselect outside a script stays disabled, as the #6744 test wants.

Tests: deselect_noop_tests::run_skips_deselect_with_nothing_selected and
batch_skips_deselect_with_nothing_selected (both fail on main).
2026-10-23 09:41:23 +02:00
Khawar Zamman WaniandClaude Opus 5.5 2d894eab2b fix(engine): tile-wise Invert edit; a run of Inverts costs one
Review of #8783:

- The Invert edit no longer builds a canvas-sized buffer: the canvas
  takes the inverse of the selection's untouched value (one shared tile
  for every fully covered tile, as fill_rect stores it), then only the
  tiles the selection holds are inverted. Byte-for-byte equal to the
  dense inversion; a 100k x 100k canvas inverts in well under a second.
- A run of Inverts is applied as one or none (pairs cancel exactly), so
  4096 of them cost at most one pass between other edits.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 11:42:26 +05:30
Khawar Zamman WaniandClaude Opus 5.5 ca13e355c9 fix(algo,engine): bound brush stroke work and total brush edit area
Review of #8783:

- matting::brush `segments` no longer collects its pieces: they are made
  as they are painted, and each segment is first cut to the painted area
  grown by the brush. A 1 px stroke zigzagging across 2 million px
  (within MAX_SWEPT_AREA) split into ~134 million pieces collected up
  front (~2 GB) in brush_region and EdgeBrush::new; now ~5000 pieces.
- select.refineEdge `edits`: the Brush edits' swept area in all is
  bounded by MAX_SWEPT_AREA, as refineStrokes' is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 11:14:50 +05:30
Finn NewickandClaude Opus 5.5 3ef632d313 fix(align): an uncached fill that shows everywhere measures as the canvas
Without a cached render, an inverted or sub-100 % density fill measured
as empty and dropped out of Align and Distribute.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:30:34 +01:00
Finn NewickandClaude Opus 5.5 ad91e9f387 fix(align): feather a measured shape over its reach, gradients in the canvas
CompiledShape::new used one rectangle as both the gradient frame and the
area a feather is computed over, so measuring in the document's frame cut
the feather off at the canvas. CompiledShape::with_frames takes the two
separately; Align measures with the feather over the shape's reach and
gradients in the canvas.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:17:56 +01:00
Finn NewickandClaude Opus 5.5 242ff51eca fix(align): lay a measured shape's gradient out in the document's frame
Align and Distribute now measure through layer_bounds_in with the
document bounds as the frame for gradients that aren't aligned with the
layer, so an opacity stop measures as the cached render shows it; only
the render clip is widened to the shape's reach.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 06:05:00 +01:00
Khawar Zamman WaniandClaude Opus 5.5 4970534e05 feat(engine): Select and Mask tool edits as select.refineEdge params
select.refineEdge takes `edits`: the Select and Mask workspace's Quick
Selection, Brush, Lasso, Object Selection, Select Subject, Clear Selection
and Invert, applied in order to the starting selection (or layer mask)
before the edge is refined. Cancel discards them, OK is one history step,
and agents drive them over MCP and the control channel.

- engine/select_mask_edits.rs: parse (bounded, every bad field an Err)
  and a pure apply/apply_one the workspace preview can share
- algo matting::brush_region: soft round brush coverage (hardness)
- ATN export reports steps with edits instead of dropping them
- "Edits" label in the 21 catalogs

Part of #7069 and #8148 (the workspace UI follows in a second PR).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:30:46 +05:30
Finn NewickandClaude Opus 5.5 9ff4b6a232 fix(align): measure a feathered shape by its soft edge
The shape is rendered over its feathered reach, not just its path and
stroke; a fill that shows everywhere (inverted path, or density below
100 %) keeps the canvas-clipped measure, having no extent of its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 05:56:26 +01:00
Finn NewickandClaude Opus 5.5 ac7f3bc559 fix(align): measure shape layers by everything they draw
Align and Distribute measured shape layers from their cached render,
which is clipped to the canvas, so a shape partly off the canvas looked
smaller and Align moved layers by the wrong amount, needing several
clicks. A shape layer is now measured from a render over its own path
and stroke bounds, unclipped (or by those bounds past 64 MP).

Fixes #8660

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 05:28:39 +01:00