a_damaged_preset_set_keeps_the_other_sets (#5602) checks that one
damaged set in the preferences file does not discard the others. It
left out export_presets, which #5344 added and #6906 put back into
load_presets_json, and recent_documents.
The test now saves an Export As preset and checks that it survives each
damaged set, recent_documents included. It also damages export_presets
and documents on their own, and gives a null set beside the Export As
presets. This is brandongunderson's change to the test in #6479,
unchanged.
Co-authored-by: brandongunderson <22452783+brandongunderson@users.noreply.github.com>
Straighten's non-crop branch runs `edit.transform` without a layer, so since Free Transform takes
the selected layers it turns all of them. That matches Photoshop ("only the selected layer(s) will
straighten"); the test pins it, with one history step and one Undo, and checks that an
unselected layer stays put.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A type render spends most of its time after the glyphs are drawn: composing each
colour's coverage over the premultiplied accumulator, dividing it back to straight
colour, and converting the tile bytes. All three are per pixel - no pixel reads a
slot another wrote - so they ran one after another on one core for no reason.
Measured on a 3.75 MP paragraph (4000 characters, 14 pt at 300 dpi, 1851 glyphs),
release, Windows 11, i5-10300H: rasterize 98.3-103.9 ms before, 60.3-61.8 ms after
(1.6-1.7x). Whole-render stage profile before: ink rect 4.1, draw 18.6-22.9, prefix
sum 7.0-8.1, composite 22.6-33.4, unpremultiply 11.2-14.0, write_region 23.8, prune
3.1 ms.
The glyph drawing, the winding prefix sum and the ink-rect pass stay on one thread:
the first two carry a running accumulator across pixels, and the band split that
would keep them bit-identical costs a second glyph traversal per band.
Native only (rayon, as the other crates): the web build keeps the serial loops.
`blocks` and `fnv` exist only for `harris_and_describe_hashes_recorded_from_the
_serial_code`, which is `#[cfg(all(target_os = "linux", target_arch =
"x86_64"))]` because the hashes it compares against go through the platform's
hypot / ln / cos / atan2 / sin_cos. Everywhere else the test is compiled out and
the two helpers are left unused, so `-D warnings` fails on `dead_code`:
error: function `blocks` is never used crates/algo/src/features.rs:704
error: function `fnv` is never used crates/algo/src/features.rs:708
They now carry the same cfg as the only thing that calls them.
CI's matrix is ubuntu-latest and windows-latest and runs clippy on both, so this
fails the Windows leg as much as a local run on macOS: `target_os = "linux"` is
false for both.
#5344 added the export_presets field to Persisted; #5616 rewrote load_presets_json to read each set with take() and its Persisted initializer lacked the new field, so main stopped compiling (E0063 at presets/mod.rs:180). Read export_presets the same way as the other sets; the existing load step and round-trip test cover it.
Co-authored-by: 00xJ0 <56056764+00xJ0@users.noreply.github.com>
Dissolve in Smart Filter blending follows the inherited color-blending path
without per-pixel coverage sampling (docs/smart-filters.md). Show a short faint
note under the Mode control in Blending Options when Dissolve is chosen, so the
limitation is visible where the mode is picked. No behaviour change.
The note is added to all 20 catalogs. The test renders the dialog body for
every layer blend mode and checks that only Dissolve paints the note.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With "Use Default Masks on Fill Layers" off, only the default reveal-all mask
goes away. Cover that contract directly for Solid Color, Gradient and Pattern
Fill: no selection and no path gives no mask; an active selection still
becomes the raster layer mask (revealing inside, hiding outside); an explicit
vector path still becomes the vector mask, with or without a selection, and no
raster mask is added next to it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
main stopped compiling when #5616 rebuilt Persisted field by field without
the export_presets field #5344 added. Same one-line fix as #6906, so it
merges cleanly whichever lands first.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The crop tool's W x H x Resolution mode converted points and picas at a
fixed 72 pt/in, while Image Size, Canvas Size (#5757), the rulers, Info
and the shape dialog use Preferences > Units & Rulers > Point/Pica Size.
With Traditional (72.27), W "72 pt" x H "1 in" at 300 ppi cropped to
300 x 300 instead of 299 x 300.
target() and ratio() now take the points per inch, and the callers
(commit_params, preset_ratio, fit_frame) pass the preference.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Alt-click branch of the Lasso uses polygon_close_reach too; this test
Alt-clicks the four corners of a 6x6 square at 100 %, checks the outline
stays open, then closes it on the first point and checks the square.
It fails with the fixed 8-point reach.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
`blocks` and `fnv` are only used by the harris/describe hash test, which runs
on Linux x86_64 only, so on Windows they were dead code and `-D warnings`
failed the build.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Wave renderer clamps the generator count to 64 (the command allows up
to 999), but a Photoshop Wave with Scale 100% mapped to filter.distort.wave
whatever its Number of Generators. A file with 332 generators opened as a
supported, editable Wave and, once its cached pixels were re-rendered,
drew 64.
Treat it like a scaled Wave: a Wave with fewer than 1 or more than 64
generators stays Photoshop's, descriptor kept verbatim and written back
unchanged. The limit is photocraft_algo::MAX_WAVE_GENERATORS, which the
renderer now clamps to as well, so the two cannot drift.
Tests: the 332-generator Wave stays unsupported and round-trips its
descriptor; a new boundary test maps 1 and 64 generators and keeps 65, 999,
0 and -1 verbatim.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The hover preview (preview_move) re-implemented the layer removal and
insertion but skipped the rest of move_to: the clip-group rules
(clip_group::Before/settle), the Background copy rules (unlocked copy)
and the Background-stays-at-the-bottom check. So the preview showed
different clipping than the drop commits, e.g. B C1* C2* U with U dropped
above C1 committed B C1* U* C2* but previewed U unclipped, and moving a
clipping base away left its layers clipped in the preview.
Factor the document-only part of move_to into apply_move and call it from
both, so they cannot drift. A drop move_to would refuse (Background off
the bottom, groups nested too deep) now has no preview either.
Tests compare preview and committed documents (stack order, clip flags and
the flattened composite) for clip-group drops, a base moved away or up
into its own group, option-drag copies, a Background copy, and refused
Background drops.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The merge with main kept both factor lines in ensure_filter_preview, and the
second (main's filter_preview_factor, #6351) shadowed smart_preview_factor, so
a smart filter edit was sized by the edited command alone again. The shared
filter_preview_factor now starts from smart_preview_factor, which falls back to
preview_factor for ordinary filters, and caps that by the view as before.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>