A group has no pixels of its own, so with Sample All Layers off Quick
Selection fell back to the composite and a click selected a whole shape
from the layers inside. The reference application selects only the brush
disc there, as on a flat area. Quick Selection now reads a flat image for a
group (not an artboard) when Sample All Layers is off; with it on, and for
an adjustment layer, it reads the composite as before.
With a base bent toward the tip, the shaft stopped where the bent base
crosses its edge and left the wedge up to the base's middle unfilled. The
shaft's end now follows the bent base to its middle, which fills the wedge
without reaching past the head's flanks, matching the reference outline.
shape.create / shape.edit round arrowConcavity to a whole percent, as the
gear and Properties fields do.
Concavity is a whole number from -50 % to 50 % of the head's length, as in
Photoshop. A negative value bends the head's base away from the tip, and the
shaft now ends where the bent base crosses the shaft's edge. Values outside
the range (documents, PSDs and settings saved with the old 0..100 range) are
clamped to the nearest end instead of failing.
- vector: arrow_line bends the base by concavity x length, both directions
- engine: shape.create / shape.edit take arrowConcavity in -50..=50
- io: PSD import keeps negative concavity, clamped to -50..50
- ui: gear and Properties Concavity are whole-number fields with the
"Closest value inserted" alert; the gear menu stays open on clicks inside
so a value can be typed
The colour and opacity bakes sample the same 97 positions, but apply_opacity cut every interval
into four (385 stops), and paint_gradient scans the stops for every pixel. Multiply the alpha in
at each shared position instead; other positions still go through apply_opacity. Raised by
CodeRabbit.
Co-Authored-By: x-labb <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Rasterize: undo the layers already converted when a later step fails (#4974)
* Rasterize: roll back through the shared compound helper when a later layer fails (#4974)
* Test that a failed Rasterize keeps a clean document clean (#4974)
* Rasterize: undo the layers already converted when a later step fails, and refuse before a step starts when there is nothing to do (#4974)
* Format the rasterize rollback tests
* Rasterize: cover the All Layers and Layer Style refusals through the real commands
* Rasterize: name the history step after the variant, and test the rollback through the real commands (#4974)
---------
Co-authored-by: skylar <[email protected]>
* Clear the clippy 1.100 lints that fail the gate on main (#13531)
Clippy 1.100.0 flags needless_range_loop in cms synth.rs (the gate
failure on main), algo photo_util.rs and an engine multichannel test,
and, on Windows only, needless_bool in format noreplace.rs, where the
cfg(unix) branch compiles away. Each loop now iterates the slice it
indexed, with the same values in the same order.
* Clear the Linux-only clippy 1.100 needless_bool lints (#13531)
paths_match in ui-egui and is_redirect in the app ended with a
cfg(not(windows)) branch that is just `false`, which clippy 1.100
flags on Linux. Each platform's branch now returns the whole
comparison: the same results, in the same order.
The Frame from Layers branch pushed make_from to 31/30 once main's
Artboard mapping was merged in. Move the Make events another module
maps (type path, artboard, layer style, frame) into
delegated_make_from, tried in the same order as before.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
* Clone Stamp and Healing Brush clone from a source set in another open document
Alt-clicking a clone source in one document and painting in another sampled the
painted document at the source point: a clone source slot held a point and a layer
but not the document. Slots now record the document (and its layer) they were set
in, and painting elsewhere samples that document, as in Photoshop.
- Engine: CloneSource gains `document` (serde default, so older slots read as
"the document being painted"). Clone Stamp, Healing Brush, the live stroke, the
Pattern Preview wrap and the brush-tip preview read the source document. Pixels
are converted to the painted document's colour mode and depth like Edit > Paste
(no ICC conversion, same as Paste). Current Layer / Current & Below use the
layer the source was set on (that document's active layer if it was deleted);
All Layers uses its composite.
- A source whose document was closed is an error asking for a new source, and
stores no aligned anchor, instead of silently sampling the wrong document.
- cloneSource.set takes an optional `"document": index` (with `source`);
cloneSource.list and set report each slot's document index.
- UI: the Clone Source panel names the source document (or says it was closed),
the source crosshair isn't drawn over another document, and the brush preview
cache includes the source document's revision.
Tests: engine tests for 8/16/32-bit with and without wrap, colour-mode conversion
(Gray > RGB16, RGB > CMYK), sampled layer, Healing Brush, live stroke vs commit,
preview, closed/invalid documents and cloneSource.set/list; a UI test that
Alt-clicks in one document and paints in another.
* Clone test: the aligned stroke past the smaller source document's edge leaves the destination unchanged
Review follow-up: with "aligned": false the stroke sampled inside the source, so it didn't test the edge its comment named, and nothing was asserted.
* Clone Stamp / Healing Brush: an empty Clone Source slot refuses to paint
clone_params fell back to ui.clone_source / ui.clone_offset when the active
slot was empty. Those coordinates carry no document, so after Alt-clicking in
one document and picking an empty slot in another, the stroke read the first
document's coordinates from the second one's pixels.
* fix: reject stale cross-document clone previews
* Clone Source: a copy opened after the source document closed isn't its source
A native copy keeps its document's ID, and a reopened document may keep its ID. A slot set in
a document that was then closed resolved that ID again once a copy was open, and painted from
the copy instead of reporting the closed source (CodeRabbit, clone_source.rs).
Session::close now marks the slots set in the closing document closed (CloneSources::forget_doc,
next to the other per-feature forget_doc calls). A closed slot refuses the stroke and its live
preview with the closed-source error, shows "Source: document closed" in the panel, reports no
`document` in cloneSource.list/set, and draws no overlay or crosshair, whatever document has the
ID now. Setting a new source clears it.
The colour-mode check `mode_refusal` in retouch_cmds/dab.rs only knew
paint.dodge and paint.sharpen, so the other dab tools painted into Indexed
Color and Bitmap documents, where the reference application refuses with an
alert. Add their arms (both `dab_cmd` and the live stroke `LiveDab::begin`
call it, so nothing is previewed either), and name the tools in the canvas
`mode_tool_name` so a press opens the same alert with OK.
Multichannel and Duotone were not measured and keep today's behaviour.
Tests: one engine file per tool (refusal text from the command and the live
stroke, pixels and History unchanged; RGB/Gray/CMYK/Lab at 8/16/32 bits,
Multichannel and Duotone keep working) and a canvas alert test for all four.
The engine refusal tests fail without the fix.
Fixes#12673Fixes#13033Fixes#12656Fixes#12967
In a CMYK layer the stroke renderer paints a foreground picked as CMYK as
those exact inks (`StrokeRenderer::composite`, #4344), but `apply_auto_erase`
built its probe from the foreground's RGB stand-in converted back to CMYK.
For a rich black (or any ink mix the RGB doesn't round-trip to) the probe
never matched the stroke's own pixels, so a stroke starting on them painted
the foreground again instead of the background.
The probe now puts the picked inks in, under the same condition the
renderer uses (CMYK target, inks picked for this foreground). Commit and
live stroke share `apply_auto_erase`, so both are fixed.
Test: a rich-black pencil line in a CMYK document, then an Auto Erase
stroke starting on it paints the background, live and committed. It fails
without the fix.
Fixes#13060
`convex_quad` accepts a quad only when it is wound clockwise on screen, so a
Perspective Crop box flipped on one axis (an Alt+corner drag past the
opposite corner along x only), which is convex but wound counter-clockwise,
was drawn red and refused by `image.perspectiveCrop` and `quad_to_rect`. The
reference application commits it mirrored, each corner mapped as it lies.
Add `convex_quad_any_winding` (the same angle and area limits, either
winding; self-crossing, degenerate and non-finite quads stay invalid) and
use it for Perspective Crop only: the `corners` check and its error text,
`quad_to_rect`, and the overlay's validity check. The homography already
maps each corner onto its own rectangle corner, so the crop comes out
mirrored. Perspective Warp steps keep the clockwise-only `convex_quad`;
clicked corners are still sorted clockwise and commit upright; a box turned
180 degrees still commits upside down.
Tests: algo (a counter-clockwise quad maps corner to corner; bow ties,
collinear, sliver and non-finite quads stay refused), and the new
perspective_crop_mirrored_tests.rs (the measured Alt-drag case commits
mirrored and is drawn valid, the command takes counter-clockwise corners,
clicks commit upright, 180 degrees upside down, invalid quads stay red).
The mirrored cases fail without the fix.
Fixes#12489
* Use craft-psd from craft-libs; remove crates/psd
* Regenerate the scorecard (28 crate roots)
* Take craft-psd at craft-libs 55d120f2
* Regenerate lockfile for current shared format crates
* Pin shared format crates to current craft-libs main
* Match brush import cap to shared decoder budget
* xtask: update layer fixtures after PSD extraction
* paint: refuse a sequential-dab stroke whose working copy is too large
apply_dab_stroke read the whole rectangle enclosing a stroke's dabs into
two dense f32 copies (and a third for the mix), sized by the area
between the dabs rather than what they paint. Two distant points asked
for gigabytes on a sparse document.
Check the three planes against a 4 GiB budget (1 GiB on 32-bit) before
reading, and paint nothing past it.
* address review: apply_dab_stroke returns Result so over-budget dab strokes fail with 'stroke too large'
* fix tests: apply_dab_stroke returns a Result
* fix tests: handle the Result of the dab-stroke functions