Filter::with_selection takes the document and selection the Layers panel
already reads for the frame, so the Artboard filter does not walk the
document a second time on every redraw.
DabGenerator::walk collected every step of a segment into a Vec before building
dabs (up to 1e7 steps in the pixel-grid mode). The steps now become dabs as the
walker emits them. Non-finite opacity, flow, hardness and spacing fall back to the
defaults in bounded_for_render, and the smoother drops points without a finite
position.
Refs #11137
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
apply_mixer_dab read and converted the whole stroke working rectangle for every dab when a sample surface was given, which made Sample All Layers strokes quadratic. It now reads fp.rect clipped to the working rectangle, which is all apply_mixer_dab_region reads. Pixels are unchanged. Refs #11133.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Smudge writes its carry buffer straight into place (no Vec per pixel) and picks up row by row; mix_back and apply_coverage read the selection one row at a time instead of one tile lookup per pixel. Output is bit-identical, tests compare against the previous per-pixel code. Refs #11132.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
BrushContext::new regenerated the procedural texture and re-applied its levels for every stroke and every symmetry pass. A bounded LRU (4 entries, 16 MiB) keyed by style, size, seed and the level settings returns the identical image. Refs #11134.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Texture at a scale other than 100% made four sample_wrap calls per pixel,
eight rem_euclid in all. Wrap the two columns and rows once and read the four
texels directly; same bits out, with a test against the old four-call form.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Conflict in crates/engine/src/jobs.rs: main's save commit point (#5333,
OPEN/COMMITTED/CANCELLED phase) met the batch's cancel state
(CANCEL_REQUESTED/WORK_FINISHED). Both now share one atomic with a
COMMITTED bit; commit vs cancel and the batch's late-cancel guard each
stay one compare-and-swap. A Batch that refuses a repeated or late cancel
reports CancelRefused::Finishing ("finishing") in jobs.cancel's
notCancelled list, still {"cancelled": 0}. control-protocol.md documents both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up (skylartaylor on #10921). A 32-bit build accepted an
Effect Cache up to 65536 MB before its 1536 MB cap, and loading kept such
a value. Apply from another Preferences tab sends every value, so
validation rejected the untouched cache and blocked the unrelated change.
load_prefs_json now clamps effectCacheMb to the range the field accepts
(accepted_effect_cache_mb, which the byte budget uses too), so an old or
hand-edited value loads as the nearest one the dialog can save.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up (CodeRabbit on #10921). A hand-edited effectCacheMb of
0 made Performance::effect_cache_budget_bytes report 0 bytes, though the
cache floors it at 1 MiB. The budget now clamps to the range the field
accepts (EFFECT_CACHE_MIN_MB..effect_cache_max_mb), and prefs::range
takes its minimum from the same constant.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up (CodeRabbit on #10921). The 1536 MB cap is about a
32-bit address space, not the browser: on 32-bit Windows a budget of
4096 MB or more saturated to usize::MAX, so the cache never evicted.
The cap (dialog range, prefs.set and the budget) now applies whenever
target_pointer_width is 32, which covers wasm32 and x86 Windows.
effect_cache_budget_bytes_for returns u64 and clamps to the accepted
maximum, and the tests compute their expectations in u64, so neither
overflows a 32-bit usize.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review follow-up (CodeRabbit on #10921):
- The Effect Cache field's range (prefs::range, which bounds both the
dialog and prefs.set) tops out at the web cap of 1536 MB in the web
build, so the dialog no longer shows and saves a value the cache never
gets. Desktop keeps 16..65536.
- The byte budget moves into effect_cache_budget_bytes_for(stored, web),
so the web cap is tested on every target, not only when tests run as
wasm32 (CI only type-checks wasm).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The prefs_usage test skipped prefs.rs entirely, so it never saw
Session::apply_prefs read performance.effectCacheMb, and the working
setting stayed in HIDDEN_UNTIL_IMPLEMENTED. The test now scans the
`impl Session` blocks of prefs.rs, as the scorecard's prefs audit does,
and the setting is shown again.
With the field visible, the web build could take a budget up to
65536 MB, more than wasm's 4 GiB address space, so the cache could grow
until allocation aborts. The new Performance::effect_cache_budget_bytes
caps it at WASM_MEMORY_USAGE_CAP_MB on the web, as
effective_memory_usage_mb does, and converts with saturating_mul: on
wasm32 the old `mb << 20` truncated mod 4 GiB (4096 MB became 0, 5000 MB
became 904 MB).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With W/H linked, `50%` in W, a click into H and `50%` there left the
shape 40x20 instead of 20x10 (and the same from H into W). H froze its
percentage base on focus gain, the frame W's transform was still
queued, so it kept the old height for the whole edit.
A focused field now reads the current size; the base is kept only from
the commit frame into the next, where egui reads the text once more.
Tests cover the click handoff both ways and W then H with Enter.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test paints a canvas frame with the dialog still open and checks
the cached texture draws nothing. paint_view now paints in a frame of
its own so its meshes don't spill into the next frame's shapes.
Resolve apps/photocraft-cli/src/args.rs: keep both ValueError variants (Metadata and main's OnOff).
Resolve docs/file-format-parity.md: keep main's entries and re-add this PR's status entry, table notes and history row.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A banded layer checks the save's interrupt before each band and before each
channel's part of a band. Once cancelled it stops there and doesn't encode the
layer again raw; the incomplete model is discarded by the caller (which returns
IoError::Cancelled), so the save never reaches its commit point and the target
is untouched. Ex carries the export's Interrupt for this.
Addresses CodeRabbit review on crates/io/src/psd_export/banded.rs.
In the default mode a drag outside the box turns the image, but the
frame never changed, so its corners left the turned image and the crop
filled them with the background colour.
Each move of the turn now starts from the frame at the press: it keeps
its size and place if it fits the turned image, else moves the shortest
way in, else shrinks about its centre (keeping its proportions) to the
largest size that fits. The view follows the frame's centre, so the box
stays put on screen. Ctrl (Cmd) held during the turn leaves the frame as
it was. Content-Aware Fill and a frame already past the canvas keep
today's behaviour (not measured).
* fix(ui): Overscroll off keeps an image smaller than the window centred (#10488)
With Tools › Overscroll off, an image smaller than the window stayed
wherever zooming around the pointer left it, inside the window, so
zooming out drifted it off centre. #1718 measured that on Photoshop 25.4,
but two reports of Photoshop itself (#10488, #4799) say it stays centred
with Overscroll off. The owner chose the centred behaviour:
scrollbars::clamp_axis now centres an axis on which the image is no
larger than the view; a larger image still can't leave its edges, and
Overscroll on keeps the free view.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(ui): Overscroll off centres a fitting rotated image (#10488)
CodeRabbit on #11085: the rotated clamp path was only tested from an
already-centred view. A 600 px square at 45 degrees, started off centre
in a 900-point view, now ends with its screen bounds centred.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* style(ui): keep the rotated centring test within rustfmt's width
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* fix(ui): Roundness previews its radius within 1 px too, and a held frame survives a factor change (#10474)
Follow-up to #10524 from its last CodeRabbit review.
- Roundness's disc reaches floor(r) pixels along an axis, so at 6 px
and k = 4 the proxy radius 1.5 reached 1 proxy px: a 4 px preview for
a 6 px result. The factor now keeps floor(r / k) * k within 1 px of
floor(r), as Squareness already does with round (k = 3 at 6 px, k = 2
at 50 px). One whole-pixel function per mode replaces the special case.
- A canvas test drives the worker across a factor change: the frame for
k = 2 stays on the canvas, at its own size, until the k = 1 frame lands.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(ui): a fractional Roundness radius previews closer at its chosen factor (#10474)
CodeRabbit on #11081: only the factors were pinned. At 6.5 px the
Roundness preview at the chosen k = 3 is compared with OK's result and
must differ less than the k = 4 preview did.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(ui): a mid-drag frame for the previous proxy factor still reaches the canvas (#10474)
CodeRabbit on #11081: the display gate keeps a held frame at any factor,
but the mid-drag publish arm still required the same factor, so a frame
finished for the factor the drag just left was dropped. It now uses
same_target_at_any_scale too; a frame already exact for the dialog is
still never displaced.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
* Type: add OpenType Numerals submenu (figure styles)
Type › OpenType › Numerals sets lnum/onum/pnum/tnum as a radio style
(Default through Tabular Oldstyle). Checkmarks follow the selection
start; TYPE-218-5 scorecard/gaps updated; parity floor 640.
* refactor(engine): one style-at-character lookup for the OpenType menus
feature_on_at and numerals_style_at each walked the runs the same way;
they now share style_at. NumeralsStyle::from_id and numerals_style_of
read the existing tables instead of repeating them.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* fix(text): persist OpenType numeral tags through PSD EngineData
Map lnum/pnum/tnum as EngineData bools and the width×height combos as
FigureStyle (Krita/Illustrator), so Numerals choices survive PSD round-trip.
* docs(gaps): note Numerals PSD figure-tag round-trip
* revert(text): keep PSD EngineData to the keys Photoshop writes
Backs out the PSD half of 18610324 and its gaps note (58813de3); the
engine reformat in that commit stays.
- `LiningFigures`, `ProportionalFigures` and `TabularFigures` are not
Photoshop EngineData keys (the commit says Photoshop only has
`OldStyle`), so writing them puts keys of our own into users' PSDs.
- The `/FigureStyle` code table (1-4) has no oracle: no Photoshop-authored
file in photocraft-corpus, and neither ag-psd nor psd-tools reads it.
AGENTS.md rule 3 asks for public specs or observation. PSD persistence
of the numeral styles can come back with a Photoshop-authored oracle.
The Numerals menu still round-trips through .pcraft.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* test(text): lock PSD EngineData to Photoshop OldStyle for numerals
Document AGENTS.md clean-room: only onum survives TySh round-trip; lnum/pnum/tnum stay .pcraft-only until a Photoshop-authored corpus oracle.
---------
Co-authored-by: FredApps <153173854+FredApps@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
When an action saves and then closes or switches away, Batch writes the
saved snapshot inside the action closure. A cancel landing after that write
made process_one return Cancelled, so the input was reported as skipped
although its output exists. The snapshot write is now final: the cancel
stops only the inputs after it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>