Skip to content

PhotoCraft: An open-source, photo editor written by scratch in pure Rust

Merge main into feat/tool-214-12-shape-feather

David Mann0b393610761e
diff --cc crates/compose/src/lib.rs
index f9c19d061,7c0ce9098..0d179cac3
--- a/crates/compose/src/lib.rs
+++ b/crates/compose/src/lib.rs
@@@ -867,11 -890,40 +892,43 @@@ pub fn paint_bounds(layer: &Layer) -> O
(!r.is_empty()).then_some(r)
}
+ /// The frame a layer's effects are laid out in: [`paint_bounds`] for a shape, else the layer's
+ /// bounds ([`layer_bounds`]). A Gradient Overlay spans it, linked patterns tile from its corner.
+ pub fn effects_frame(layer: &Layer, canvas: Rect) -> Rect {
+ paint_bounds(layer).unwrap_or_else(|| layer_bounds(layer, canvas))
+ }
+
+ /// The pixels a change from `a` to `b` repaints beyond those it changed: where a layer whose
+ /// effects span its frame ([`effects::spans_frame`]) moved that frame, the layer's whole composite
+ /// before and after. Painting on a layer with a Gradient Overlay lays the one gradient out again
+ /// over the grown layer, as Photoshop does after each stroke; damage that covers only the stroke
+ /// leaves the old gradient around earlier strokes (#4053). Empty when no such frame moved.
+ pub fn relayout_damage(a: &Document, b: &Document) -> Rect {
+ let mut out = Rect::EMPTY;
+ let mut add = |r: Rect| {
+ if !r.is_empty() {
+ out = if out.is_empty() { r } else { out.union(&r) };
+ }
+ };
+ for (_, _, y) in b.walk() {
+ if !y.visible || !effects::spans_frame(y) {
+ continue;
+ }
+ let Some(x) = a.layer(y.id) else { continue };
+ if effects_frame(x, a.bounds()) == effects_frame(y, b.bounds()) {
+ continue;
+ }
+ add(change_bounds(x, a.bounds()).unwrap_or_else(|| a.bounds()));
+ add(change_bounds(y, b.bounds()).unwrap_or_else(|| b.bounds()));
+ }
+ out
+ }
+
-/// The bounding box of a shape layer's vector content: its path control bounds plus stroke width.
-pub fn shape_bounds(sh: &photocraft_doc::ShapeLayer) -> Option<Rect> {
+/// The bounding box of a shape layer's path and stroke, ignoring its Density and Feather: its
+/// path control bounds plus stroke width. It is the frame Free Transform and the Move tool's
+/// transform controls show for a soft shape, whose rendering reaches past it (in Photoshop a
+/// shape's transform frame follows its path whatever its mask Density and Feather).
+pub fn hard_shape_bounds(sh: &photocraft_doc::ShapeLayer) -> Option<Rect> {
if sh.fill.is_none() && sh.stroke.as_ref().is_none_or(|s| s.width <= 0.0 || s.opacity <= 0.0) {
return None;
}
diff --cc crates/engine/src/transform_cmds.rs
index baab06980,2452e7443..afebf3546
--- a/crates/engine/src/transform_cmds.rs
+++ b/crates/engine/src/transform_cmds.rs
@@@ -54,12 -54,9 +54,12 @@@ fn framed_by_selection(doc: &Document,
}
/// A group moves all its descendants, so its frame must not clip raster children to the selection.
- fn whole_layer_bounds(layer: &Layer) -> Rect {
+ pub(crate) fn whole_layer_bounds(layer: &Layer) -> Rect {
let content = match &layer.content {
LayerContent::Group(g) => g.children.iter().map(whole_layer_bounds).fold(Rect::EMPTY, |a, b| a.union(&b)),
+ // A soft shape (Density below 100 % or a Feather) renders past its path, over the whole
+ // canvas below 100 %: its frame follows the path and stroke, as in Photoshop (#5846).
+ LayerContent::Shape(sh) if sh.has_soft_mask() => photocraft_compose::hard_shape_bounds(sh).unwrap_or(Rect::EMPTY),
_ => layer.surface().map_or(Rect::EMPTY, photocraft_compose::bounds::content_bounds),
};
if content.is_empty() { layer.mask.as_ref().map_or(Rect::EMPTY, |m| photocraft_compose::bounds::content_bounds(&m.surface)) } else { content }
diff --cc docs/scorecard.md
index b11c92f69,c4b53a20f..cec44ff15
--- a/docs/scorecard.md
+++ b/docs/scorecard.md
@@@ -8,11 -8,11 +8,11 @@@ Generated by `cargo xtask scorecard` fr
|---|---:|---:|---:|---|
| [Performance](#performance) | 3 | 22 | 24 | 58 scenarios: 3 within budget, 22 over budget or failing, 9 tracked only, 19 not run, 5 not measurable yet (baseline 2026-10-05) |
| [File compatibility](#file-compatibility) | 7 | 14 | 6 | io corpus: oracle ≥ 148/170, round trip ≥ 169/170; psd-tools corpus: oracle ≥ 249/309, round trip ≥ 308/309; photoshop oracles: oracle ≥ 188/256, round trip ≥ 258/256 |
-| [Tools](#tools) | 33 | 11 | 0 | |
+| [Tools](#tools) | 34 | 10 | 0 | |
- | [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 26 of 168 (target 0) |
+ | [Workspace and UI](#workspace-and-ui) | 13 | 6 | 4 | settings that do nothing: 25 of 169 (target 0) |
| [Type](#type) | 4 | 3 | 2 | |
| [Automation](#automation) | 5 | 2 | 4 | 631 of 631 menu items live (100.0%) |
- | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 29 of 29 crates; panic_hunt present |
+ | [Reliability](#reliability) | 5 | 2 | 0 | never-crash lints on 30 of 30 crates; panic_hunt present |
| [Distribution](#distribution) | 5 | 4 | 2 | |
| [Open bugs](#open-bugs) | 29 | 2 | 1 | |
diff --cc docs/target-app-parity.md
index 22901de90,3eca518c2..819a6ceda
--- a/docs/target-app-parity.md
+++ b/docs/target-app-parity.md
@@@ -1,6 -1,6 +1,6 @@@
# PhotoCraft vs Adobe Photoshop: target-app parity
- > **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-15 · **Change:** minor (shape layers take Density and Feather, TOOL-214-12 done, #5846; on-canvas corner radius widgets, TOOL-214-12; `.atn` import maps 112 events; Free Transform H/V skew fields; stale rows corrected against `main` and the scorecard, estimates unchanged; Photoshop Actions `.atn` load and save; 2026-10-10: Tilt-Shift measurements added; earlier the same day: major, full re-measure against Photoshop 2026 27.11.0; merged `parity-estimate.md` and the roadmap's honest assessment; stale missing-tool rows corrected: Color Replacement and Red Eye are live toolbar tools, Frame landed; percentages unchanged) · **Target:** Adobe Photoshop 2026
-> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-18 · **Change:** minor (fill and adjustment layers copy and paste whole, UI-217-23 partial, #2344; on-canvas corner radius widgets, TOOL-214-12; `.atn` import maps 112 events; Free Transform H/V skew fields; stale rows corrected against `main` and the scorecard, estimates unchanged; Photoshop Actions `.atn` load and save; 2026-10-10: Tilt-Shift measurements added; earlier the same day: major, full re-measure against Photoshop 2026 27.11.0; merged `parity-estimate.md` and the roadmap's honest assessment; stale missing-tool rows corrected: Color Replacement and Red Eye are live toolbar tools, Frame landed; percentages unchanged) · **Target:** Adobe Photoshop 2026
++> **Last reviewed:** 2026-10-12 · **Last updated:** 2026-10-18 · **Change:** minor (fill and adjustment layers copy and paste whole, UI-217-23 partial, #2344; shape layers take Density and Feather, TOOL-214-12 done, #5846; on-canvas corner radius widgets, TOOL-214-12; `.atn` import maps 112 events; Free Transform H/V skew fields; stale rows corrected against `main` and the scorecard, estimates unchanged; Photoshop Actions `.atn` load and save; 2026-10-10: Tilt-Shift measurements added; earlier the same day: major, full re-measure against Photoshop 2026 27.11.0; merged `parity-estimate.md` and the roadmap's honest assessment; stale missing-tool rows corrected: Color Replacement and Red Eye are live toolbar tools, Frame landed; percentages unchanged) · **Target:** Adobe Photoshop 2026
The authoritative answer to "how close is PhotoCraft to Photoshop, and how much work is left". The
one-page summary is [`ROADMAP.md`](../ROADMAP.md); the ranked work list is [`gaps.md`](gaps.md);
@@@ -565,7 -565,7 +565,8 @@@ See [method, raw measurements and repro
| Date | Change | Summary |
|---|---|---|
+ | 2026-10-18 | minor | Layers: with no selection, Copy takes fill and adjustment layers whole and Paste recreates them (#2344); UI-217-23 stays partial; percentages unchanged |
+| 2026-10-15 | minor | Vector shapes: shape layers take Density and Feather (Properties › Masks), PSD and .pcraft round trip; TOOL-214-12 done (#5846); estimates unchanged |
| 2026-10-13 | minor | Vector shapes: on-canvas corner radius widgets on live rectangles (TOOL-214-12); estimates unchanged |
| 2026-10-13 | minor | Stale "missing tool" rows corrected against main: Color Replacement (`paint.colorReplacement`), Red Eye (`paint.redEye`) and Add/Delete Anchor Point (the Pen flyout) are live toolbar tools and Frame landed, so Art History Brush is the only tool still missing; percentages unchanged |
| 2026-10-12 | minor | Free Transform options bar H/V skew fields; percentages unchanged |