PhotoCraft: An open-source, photo editor written by scratch in pure Rust
Merge PR #7574: Move tool: moving selected pixels shrinks the selection, transform controls and snapping to them (#7538)
aiongge42cfd2159b0
diff --cc crates/engine/src/float_cmds.rsindex bffb67076,92e48692d..17be8598d--- a/crates/engine/src/float_cmds.rs+++ b/crates/engine/src/float_cmds.rs@@@ -32,7 -33,11 +33,12 @@@ pub struct CutPartspub layer: LayerId,rest: Surface,piece: Surface,+ piece_bounds: photocraft_geom::Rect,+ /// The selection the moved pixels take, unmoved: the alpha the piece took, the selection+ /// limited to the layer's transparency (Photoshop shrinks the marching ants to the piece as the+ /// drag starts, #7538). `None` keeps the selection: a mask has no transparency, and an empty+ /// piece no outline.+ outline: Option<Surface>,/// The pieces are the layer's mask (`"target":"mask"`), not its pixels.mask: bool,}@@@ -56,27 -61,71 +62,45 @@@ impl CutParts};let fmt = surf.format();let with_alpha = PixelFormat::new(fmt.mode, fmt.sample, true);- let full = if fmt == with_alpha { surf.clone() } else { surf.convert(with_alpha) };// A mask has no alpha: it keeps its format, and the cut leaves background colour.- let mut rest = if mask { surf.clone() } else { full.clone() };+ let base = if mask || fmt == with_alpha { surf.clone() } else { surf.convert(with_alpha) };+ let mut rest = base.clone();let mut piece = Surface::new(with_alpha);- let mut outline = Surface::new(PixelFormat::new(ColorMode::Grayscale, sel.format().sample, false));++ let mut outline: Option<Surface> = None;let fill = !copy && (mask || doc.is_background(layer));// A mask's untouched pixels (its default, e.g. white) move too, so take the whole canvas.- let b = sel.content_bounds().intersect(&if mask { doc.bounds() } else { surf.content_bounds() });+ let b = sel.content_bounds().intersect(&if mask { doc.bounds() } else { base.content_bounds() });if !b.is_empty() {- let n = with_alpha.channels();- let a = n - 1;- let mut rp = full.read_region(b);- let mut pp = rp.clone();- let w = b.width() as usize;- let mut cover = Vec::with_capacity(if mask { 0 } else { w * b.height() as usize });- for (i, (p, r)) in pp.chunks_exact_mut(n).zip(rp.chunks_exact_mut(n)).enumerate() {- let k = sel.sample_channel(b.x0 + (i % w) as i32, b.y0 + (i / w) as i32, 0).clamp(0.0, 1.0);- if mask {- // A mask has no alpha of its own: its selected part moves by the selection.- if k <= 0.0 {- p.fill(0.0);- } else {- p[a] *= k;- }- continue;- }- // The selection is how much of each pixel's alpha moves, at most all of it, as- // Photoshop's Move tool lifts it (#7538): a feathered selection over opaque pixels- // lifts k of them and leaves 1 − k, while one no stronger than the pixels' own- // alpha (the outline a previous move left) lifts them whole. Multiplying instead- // left a × (1 − a) of every half-transparent edge pixel behind, a faint outline.- let lifted = p[a].min(k);- // The moved pixels' selection is what they took with them (Photoshop's marching- // ants hug the 50 % line of a soft edge), so moving them again lifts them whole.- cover.push(lifted);- if lifted <= 0.0 {- p.fill(0.0);- } else {- p[a] = lifted;- }- if !copy && !fill {- r[a] -= lifted;- }- }+ piece = cut_piece(&base, sel, b, with_alpha)?;++ // The moved pixels' selection is what they took with them: the alpha the piece++ // holds, which is the selection limited to the layer's own coverage (Photoshop's++ // marching ants hug the piece as the drag starts, #7538). A mask has no outline.+ if !mask {- rest.write_region(b, &rp);++ let n = with_alpha.channels();++ let cover: Vec<f32> = piece.read_region(b).chunks_exact(n).filter_map(|p| p.last().copied()).collect();++ let mut o = Surface::new(PixelFormat::new(ColorMode::Grayscale, sel.format().sample, false));++ o.write_region(b, &cover);++ o.prune();++ outline = Some(o);+ }if fill {- crate::pixels::try_fill_surface(&mut rest, b, background, Some(sel), true)?;- }- rest.prune();- if !mask {- outline.write_region(b, &cover);- outline.prune();+ let opaque_bg = [background[0], background[1], background[2], 1.0];+ crate::pixels::try_fill_surface(&mut rest, b, opaque_bg, Some(sel), false)?;+ if mask {+ rest.prune();+ }+ } else if !copy && !mask {+ crate::pixels::try_lift_coverage(&mut rest, b, sel)?;}- piece.write_region(b, &pp);- piece.prune();}- let outline = (!outline.content_bounds().is_empty()).then_some(outline);- Ok(Self { layer, rest, piece, outline, mask })+ let piece_bounds = piece.content_bounds();- Ok(Self { layer, rest, piece, piece_bounds, mask })++ let outline = outline.filter(|o| !o.content_bounds().is_empty());++ Ok(Self { layer, rest, piece, piece_bounds, outline, mask })+ }++ /// The selection the moved pixels take, where they were cut (`None`: the selection stays).+ pub fn outline(&self) -> Option<&Surface> {+ self.outline.as_ref()}/// `doc` with the piece moved by whole pixels (dx, dy) over the cut-out layer.diff --cc crates/engine/src/float_cmds/tests.rsindex 130b07f2a,eca31d43a..44c887643--- a/crates/engine/src/float_cmds/tests.rs+++ b/crates/engine/src/float_cmds/tests.rs@@@ -227,112 -190,191 +227,301 @@@ fn cutting_an_untouched_part_of_the_masassert_eq!(mask_at(&s, 40, 12), 0.0);}+/// #7655: a selection loaded from the layer's own transparency lifts its half-transparent pixels+/// whole, leaving nothing behind (Photoshop); a half selection of an opaque pixel still splits it.+#[test]+fn a_layers_own_transparency_floats_its_soft_pixels_whole() {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 80, "height": 60, "background": "transparent"})).unwrap();+ let id = s.active().unwrap().active_layer.unwrap();+ s.edit("paint", |doc, _| {+ let surf = doc.layer_mut(id).unwrap().surface_mut().unwrap();+ surf.fill_rect(Rect::new(10, 10, 20, 30), &[1.0, 0.0, 0.0, 0.5]);+ surf.fill_rect(Rect::new(20, 10, 30, 30), &[1.0, 0.0, 0.0, 1.0]);+ Ok(())+ })+ .unwrap();+ s.execute("select.loadSelection", json!({"channel": "transparency"})).unwrap();+ s.execute("select.float", json!({"dx": 0, "dy": 25})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let d = &s.active().unwrap().doc;+ assert_eq!(alpha(d, id, 15, 20), 0.0, "no ghost where the soft pixels were");+ assert!((alpha(d, id, 15, 45) - 0.5).abs() < 0.01, "they moved whole: {}", alpha(d, id, 15, 45));+ assert_eq!((alpha(d, id, 25, 20), alpha(d, id, 25, 45)), (0.0, 1.0));++ // A copy (⌥) of them is as solid as they are, as Photoshop's Layer via Copy of the same+ // selection is, and leaves them where they were.+ s.undo();+ s.execute("select.loadSelection", json!({"channel": "transparency"})).unwrap();+ s.execute("select.float", json!({"dx": 0, "dy": 25, "copy": true})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let d = &s.active().unwrap().doc;+ assert!((alpha(d, id, 15, 20) - 0.5).abs() < 0.01 && (alpha(d, id, 15, 45) - 0.5).abs() < 0.01, "{} {}", alpha(d, id, 15, 20), alpha(d, id, 15, 45));++ // A half selection of an opaque pixel splits it half and half, as before.+ let (mut s, id) = session();+ s.execute("select.all", json!({})).unwrap();+ s.edit("half", |doc, _| {+ let sel = doc.selection.as_mut().unwrap();+ sel.fill_rect(doc_rect(80, 60), &[0.5]);+ Ok(())+ })+ .unwrap();+ s.execute("select.float", json!({"dx": 40, "dy": 0})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let d = &s.active().unwrap().doc;+ assert!((alpha(d, id, 15, 15) - 0.5).abs() < 0.01 && (alpha(d, id, 55, 15) - 0.5).abs() < 0.01);+}++fn doc_rect(w: i32, h: i32) -> Rect {+ Rect::new(0, 0, w, h)+}++#[test]+fn float_shares_interior_tiles_on_cut_and_place() {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 1024, "height": 1024})).unwrap();+ s.tools.background = [0.2, 0.4, 0.8, 1.0];+ let id = s.active().unwrap().active_layer.unwrap();+ // Paint non-uniform pixels so original tiles are distinct.+ s.edit("pattern", |doc, _| {+ let surf = doc.layer_mut(id).unwrap().surface_mut().unwrap();+ for ty in 0..4 {+ for tx in 0..4 {+ surf.write_pixel(tx * 256 + 5, ty * 256 + 5, &[tx as f32 * 0.25, ty as f32 * 0.25, 0.5, 1.0]);+ }+ }+ Ok(())+ })+ .unwrap();+ // Select (100..900)^2, which fully covers interior tiles (1, 1) and (2, 2).+ s.execute("select.rect", json!({"x": 100, "y": 100, "width": 800, "height": 800})).unwrap();+ s.execute("select.float", json!({})).unwrap();+ let st = s.active().unwrap();+ let orig = st.doc.layer(id).unwrap().surface().unwrap();+ let parts = &floating(st).unwrap().parts;+ let tc1 = photocraft_geom::TileCoord { tx: 1, ty: 1 };+ let tc2 = photocraft_geom::TileCoord { tx: 2, ty: 2 };+ // Interior tiles of `piece` share the original layer's Arc<Tile>.+ assert!(Arc::ptr_eq(orig.tile(tc1).unwrap(), parts.piece.tile(tc1).unwrap()));+ assert!(Arc::ptr_eq(orig.tile(tc2).unwrap(), parts.piece.tile(tc2).unwrap()));+ // Interior tiles of the Background hole in `rest` share one solid fill Arc<Tile>.+ assert!(Arc::ptr_eq(parts.rest.tile(tc1).unwrap(), parts.rest.tile(tc2).unwrap()));+ // Moving by a whole tile (256, 0) shares the interior tile directly in the preview document.+ let shown = displayed(st, (256, 0)).unwrap();+ let shown_surf = shown.layer(id).unwrap().surface().unwrap();+ let moved_tc = photocraft_geom::TileCoord { tx: 2, ty: 1 };+ assert!(Arc::ptr_eq(orig.tile(tc1).unwrap(), shown_surf.tile(moved_tc).unwrap()));+}++#[test]+fn float_feathered_selection_preserves_partial_alpha_across_depths() {+ for depth in [8, 16, 32] {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 120, "height": 80, "background": "transparent", "depth": depth})).unwrap();+ let id = s.active().unwrap().active_layer.unwrap();+ s.edit("paint", |doc, _| {+ doc.layer_mut(id).unwrap().surface_mut().unwrap().fill_rect(Rect::new(0, 0, 55, 80), &[1.0, 0.0, 0.0, 1.0]);+ Ok(())+ })+ .unwrap();+ s.execute("select.rect", json!({"x": 20, "y": 20, "width": 30, "height": 30, "feather": 4.0})).unwrap();+ s.execute("select.float", json!({"dx": 40, "dy": 0})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let surf = s.active().unwrap().doc.layer(id).unwrap().surface().unwrap();+ // Center of moved piece is opaque red; center of hole is transparent; feathered edge has partial alpha.+ assert!(surf.rgba(75, 35)[3] > 0.95, "{depth}-bit moved center");+ assert!(surf.rgba(35, 35)[3] < 0.05, "{depth}-bit hole center");+ let edge_a = surf.rgba(60, 35)[3];+ assert!(edge_a > 0.1 && edge_a < 0.9, "{depth}-bit feathered edge alpha={edge_a}");+ }+}+++ /// Coverage of `d`'s selection at (x, y).+ fn selected(d: &Document, x: i32, y: i32) -> f32 {+ d.selection.as_ref().map_or(0.0, |s| s.sample_channel(x, y, 0))+ }++ /// #7538: a marquee drawn loosely around an object on a transparent layer shrinks to the object+ /// once its pixels move, as in Photoshop, at every depth and when moving a copy.+ #[test]+ fn moving_shrinks_the_selection_to_the_moved_pixels_at_every_depth() {+ for depth in [8, 16, 32] {+ for copy in [false, true] {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 80, "height": 60, "background": "transparent", "depth": depth})).unwrap();+ s.execute("select.rect", json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap();+ s.execute("edit.fill", json!({"color": "#ff0000"})).unwrap();+ // A marquee with empty space all round the red square.+ s.execute("select.rect", json!({"x": 4, "y": 6, "width": 34, "height": 30})).unwrap();+ s.execute("select.float", json!({"dx": 20, "dy": 5, "copy": copy})).unwrap();+ let st = s.active().unwrap();+ let outline = floating(st).unwrap().parts.outline().unwrap();+ assert_eq!(outline.content_bounds(), Rect::new(10, 10, 30, 30), "{depth}-bit, copy {copy}: the outline while floating");+ assert_eq!(st.doc.selection.as_ref().unwrap().content_bounds(), Rect::new(4, 6, 38, 36), "the document's is untouched");+ s.execute("select.drop", json!({})).unwrap();+ let doc = &s.active().unwrap().doc;+ assert_eq!(doc.selection.as_ref().unwrap().content_bounds(), Rect::new(30, 15, 50, 35), "{depth}-bit, copy {copy}");+ assert_eq!((selected(doc, 40, 25), selected(doc, 26, 13)), (1.0, 0.0), "{depth}-bit, copy {copy}: the moved square only");+ // Undo brings back the marquee as it was drawn.+ s.undo();+ assert_eq!(s.active().unwrap().doc.selection.as_ref().unwrap().content_bounds(), Rect::new(4, 6, 38, 36), "{depth}-bit, copy {copy}");+ }+ }+ }++ /// The new selection is what each pixel took with it: the selection, at most the pixel's alpha. A+ /// soft selection keeps its soft edge; a half-transparent pixel half selected moves whole.+ #[test]+ fn the_outline_is_what_the_moved_pixels_took() {+ let (mut s, id) = session();+ s.edit("soften", |doc, _| {+ // Half-transparent red over (30..40, 10..30), beside the opaque (10..30)² square.+ doc.layer_mut(id).unwrap().surface_mut().unwrap().fill_rect(Rect::new(30, 10, 40, 30), &[1.0, 0.0, 0.0, 0.5]);+ let mut sel = Surface::new(PixelFormat::GRAY8);+ sel.fill_rect(Rect::new(0, 0, 60, 50), &[0.5]);+ sel.fill_rect(Rect::new(10, 10, 20, 30), &[1.0]);+ doc.selection = Some(sel);+ Ok(())+ })+ .unwrap();+ s.execute("select.float", json!({"dx": 10, "dy": 0})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let doc = &s.active().unwrap().doc;+ let near = |x: i32, y: i32, want: f32| assert!((selected(doc, x, y) - want).abs() < 0.01, "({x}, {y}): {} for {want}", selected(doc, x, y));+ near(25, 20, 1.0); // fully selected, opaque+ near(35, 20, 0.5); // half selected, opaque: half of it moved+ near(45, 20, 0.5); // half selected, half transparent: all of it moved+ near(5, 5, 0.0); // selected, but nothing there+ assert_eq!(doc.selection.as_ref().unwrap().content_bounds(), Rect::new(20, 10, 50, 30));+ }++ /// Where the selection is the moved piece already (the Background, which has no transparency)+ /// or the piece has no outline (a mask, or only transparent pixels), the selection just moves.+ #[test]+ fn the_selection_just_moves_without_transparency_to_shrink_to() {+ // The Background.+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 40, "height": 40})).unwrap();+ s.execute("select.rect", json!({"x": 5, "y": 5, "width": 10, "height": 10})).unwrap();+ s.execute("select.float", json!({"dx": 15, "dy": 0})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ assert_eq!(s.active().unwrap().doc.selection.as_ref().unwrap().content_bounds(), Rect::new(20, 5, 30, 15), "the Background");+ // Only transparent pixels selected.+ let (mut s, _) = session();+ s.execute("select.rect", json!({"x": 40, "y": 5, "width": 10, "height": 10})).unwrap();+ s.execute("select.float", json!({"dx": 5, "dy": 0})).unwrap();+ assert!(floating(s.active().unwrap()).unwrap().parts.outline().is_none());+ s.execute("select.drop", json!({})).unwrap();+ assert_eq!(s.active().unwrap().doc.selection.as_ref().unwrap().content_bounds(), Rect::new(45, 5, 55, 15), "an empty piece");+ // The mask: it has no transparency of its own.+ let (mut s, id) = session();+ s.edit("mask", |doc, _| {+ doc.layer_mut(id).unwrap().mask = Some(photocraft_doc::LayerMask::reveal_all());+ Ok(())+ })+ .unwrap();+ s.execute("select.rect", json!({"x": 5, "y": 5, "width": 40, "height": 40})).unwrap();+ s.execute("select.float", json!({"dx": 5, "dy": 0, "target": "mask"})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ assert_eq!(s.active().unwrap().doc.selection.as_ref().unwrap().content_bounds(), Rect::new(10, 5, 50, 45), "the mask");+ }++ /// #7538: an anti-aliased shape moved, dropped, then moved again from its shrunk selection leaves+ /// nothing behind. With the selection shrunk to the pixels' alpha, the second move left+ /// a × (1 − a) of each edge pixel (up to 25 %), a faint outline where the shape had been.+ #[test]+ fn moving_again_from_the_shrunk_selection_leaves_no_edge_behind() {+ for depth in [8, 16, 32] {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 120, "height": 100, "background": "transparent", "depth": depth})).unwrap();+ s.execute("select.rect", json!({"x": 20, "y": 20, "width": 50, "height": 40, "ellipse": true})).unwrap();+ s.execute("edit.fill", json!({"color": "#0000ff"})).unwrap();+ let id = s.active().unwrap().active_layer.unwrap();+ let total = |doc: &Document| (0..100).flat_map(|y| (0..120).map(move |x| (x, y))).map(|(x, y)| alpha(doc, id, x, y)).sum::<f32>();+ let (before, soft) = {+ let doc = &s.active().unwrap().doc;+ (total(doc), (0..100).flat_map(|y| (0..120).map(move |x| (x, y))).filter(|&(x, y)| (0.01..0.99).contains(&alpha(doc, id, x, y))).count())+ };+ assert!(soft > 20, "{depth}-bit: the ellipse has anti-aliased edges ({soft})");+ s.execute("select.rect", json!({"x": 10, "y": 10, "width": 70, "height": 60})).unwrap();+ s.execute("select.float", json!({"dx": 40, "dy": 30})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ // The ellipse now sits at (60..110, 50..90); move it back where it started.+ s.execute("select.float", json!({"dx": -40, "dy": -30})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let doc = &s.active().unwrap().doc;+ let leftover = (50..100)+ .flat_map(|y| (55..115).map(move |x| (x, y)))+ .filter(|&(x, y)| x >= 72 || y >= 62)+ .map(|(x, y)| alpha(doc, id, x, y))+ .fold(0.0f32, f32::max);+ assert_eq!(leftover, 0.0, "{depth}-bit: nothing left where it was moved from");+ assert!((total(doc) - before).abs() < 0.05, "{depth}-bit: every edge pixel came back whole ({} vs {before})", total(doc));+ }+ }++ /// #7538, measured in Photoshop 2025: after moving a soft-edged shape from a loose marquee, the+ /// selection's strength at each edge pixel is that pixel's alpha (its marching ants run along the+ /// edge's 50 % line, and Quick Mask shows the edge partly selected), and a feathered selection+ /// over opaque pixels still lifts only part of them, leaving the rest behind.+ #[test]+ fn a_soft_edge_is_as_selected_as_it_is_opaque_and_feathered_moves_leave_the_rest() {+ let (mut s, id) = session();+ s.edit("soft edge", |doc, _| {+ let surf = doc.layer_mut(id).unwrap().surface_mut().unwrap();+ for (x, a) in [(30, 0.75), (31, 0.5), (32, 0.25)] {+ surf.fill_rect(Rect::new(x, 10, x + 1, 30), &[1.0, 0.0, 0.0, a]);+ }+ Ok(())+ })+ .unwrap();+ s.execute("select.rect", json!({"x": 5, "y": 5, "width": 40, "height": 30})).unwrap();+ s.execute("select.float", json!({"dx": 10, "dy": 0})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let doc = &s.active().unwrap().doc;+ for (x, a) in [(39, 1.0), (40, 0.75), (41, 0.5), (42, 0.25), (43, 0.0)] {+ assert!((selected(doc, x, 20) - a).abs() < 0.01, "x {x}: selected {} where alpha {a}", selected(doc, x, 20));+ assert!((alpha(doc, id, x, 20) - a).abs() < 0.01, "x {x}: the pixel moved whole");+ }+ assert!((10..20).all(|x| alpha(doc, id, x, 20) == 0.0), "nothing left where it was");++ // A feathered (half) selection over opaque pixels lifts half of them and leaves half.+ let (mut s, id) = session();+ s.edit("half", |doc, _| {+ let mut sel = Surface::new(PixelFormat::GRAY8);+ sel.fill_rect(Rect::new(10, 10, 30, 30), &[0.5]);+ doc.selection = Some(sel);+ Ok(())+ })+ .unwrap();+ s.execute("select.float", json!({"dx": 30, "dy": 0})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let doc = &s.active().unwrap().doc;+ assert!((alpha(doc, id, 15, 20) - 0.5).abs() < 0.01 && (alpha(doc, id, 45, 20) - 0.5).abs() < 0.01, "half left, half moved");+ }++ /// #7538: arrow nudges add up to one floating piece, so up then down is back at no offset. The+ /// selection is the moved pixels' all the same, as after each of Photoshop's nudges, in one step;+ /// a piece that never moved (a click) changes nothing.+ #[test]+ fn nudging_away_and_back_keeps_the_moved_pixels_selection() {+ let (mut s, _) = session();+ s.execute("select.rect", json!({"x": 2, "y": 2, "width": 40, "height": 40})).unwrap();+ let steps = s.active().unwrap().history.past_len();+ s.execute("select.float", json!({"dx": 0, "dy": -1})).unwrap();+ s.execute("select.float", json!({"dx": 0, "dy": 1})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let st = s.active().unwrap();+ assert_eq!(st.doc.selection.as_ref().map(|s| s.content_bounds()), Some(Rect::new(10, 10, 30, 30)), "the moved square's");+ assert_eq!(st.history.past_len(), steps + 1, "one step");+ s.undo();+ assert_eq!(s.active().unwrap().doc.selection.as_ref().map(|s| s.content_bounds()), Some(Rect::new(2, 2, 42, 42)), "undone");++ // A click: cut, never moved, dropped.+ s.execute("select.float", json!({"dx": 0, "dy": 0})).unwrap();+ s.execute("select.drop", json!({})).unwrap();+ let st = s.active().unwrap();+ assert_eq!(st.doc.selection.as_ref().map(|s| s.content_bounds()), Some(Rect::new(2, 2, 42, 42)), "a click keeps the marquee");+ assert_eq!(st.history.past_len(), steps, "and adds no step");+ }diff --cc crates/engine/src/layer_multi_cmds.rsindex 6010f63cf,6400f1214..4181451fa--- a/crates/engine/src/layer_multi_cmds.rs+++ b/crates/engine/src/layer_multi_cmds.rs@@@ -3037,321 -2734,37 +3046,354 @@@ mod testsassert_eq!(v["selectedLayers"], json!([a.0, b.0]));assert_eq!(v["layers"][0]["selected"], true);}++ /// #7538: `selection: true` moves the selection with the layers in the same step, as the Move+ /// tool does with several layers selected; without it the selection stays.+ #[test]+ fn translate_can_carry_the_selection_in_the_same_step() {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 100, "height": 100, "background": "transparent"})).unwrap();+ let a = s.active().unwrap().active_layer.unwrap();+ s.execute("select.rect", json!({"x": 10, "y": 10, "width": 20, "height": 20})).unwrap();+ s.execute("edit.fill", json!({"color": "#ff0000"})).unwrap();+ let b = LayerId(s.execute("layer.new.layer", json!({})).unwrap()["layer"].as_u64().unwrap());+ s.execute("select.rect", json!({"x": 50, "y": 10, "width": 20, "height": 20})).unwrap();+ s.execute("edit.fill", json!({"color": "#0000ff"})).unwrap();+ s.execute("layer.select", json!({"layer": a.0, "mode": "add"})).unwrap();+ s.execute("select.rect", json!({"x": 5, "y": 5, "width": 70, "height": 30})).unwrap();+ let sel = |s: &Session| s.active().unwrap().doc.selection.as_ref().map(|m| m.content_bounds());+ let bounds = |s: &Session, id: LayerId| s.active().unwrap().doc.layer(id).unwrap().surface().unwrap().content_bounds();+ let steps = s.active().unwrap().history.past_len();+ s.execute("layer.translate", json!({"dx": 7, "dy": 20, "selection": true})).unwrap();+ assert_eq!((bounds(&s, a), bounds(&s, b)), (Rect::new(17, 30, 37, 50), Rect::new(57, 30, 77, 50)));+ assert_eq!(sel(&s), Some(Rect::new(12, 25, 82, 55)), "the selection came along");+ assert_eq!(s.active().unwrap().history.past_len(), steps + 1, "one step");+ s.undo();+ assert_eq!((sel(&s), bounds(&s, a)), (Some(Rect::new(5, 5, 75, 35)), Rect::new(10, 10, 30, 30)), "undone together");+ s.execute("layer.translate", json!({"dx": 7, "dy": 20})).unwrap();+ assert_eq!(sel(&s), Some(Rect::new(5, 5, 75, 35)), "without it the selection stays");+ let state = |s: &Session| (bounds(s, a), bounds(s, b), sel(s), s.active().unwrap().history.past_len());+ let before = state(&s);+ for dx in [1, 0] {+ assert!(s.execute("layer.translate", json!({"dx": dx, "selection": "yes"})).is_err(), "dx {dx}: a bad `selection` is an error");+ assert_eq!(state(&s), before, "dx {dx}: and changes nothing");+ }+ }}++#[cfg(test)]+mod layers_panel_parity_tests {+ use super::*;++ /// A 24×16 document with three layers, "Test 0" to "Test 2", above the Background; the last one is active.+ fn new_session() -> (Session, Vec<LayerId>) {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 24, "height": 16})).unwrap();+ let ids = (0..3).map(|n| LayerId(s.execute("layer.new.layer", json!({"name": format!("Test {n}")})).unwrap()["layer"].as_u64().unwrap())).collect();+ (s, ids)+ }++ /// Set one Layers panel option in the preferences, as the Panel Options dialog does.+ fn option(s: &mut Session, key: &str, enabled: bool) {+ s.prefs.edit(|p| {+ let val = p.dialogs.entry("ui.layersPanelOptions".into()).or_insert_with(|| json!({}));+ if let Some(o) = val.as_object_mut() {+ o.insert(key.to_owned(), json!(enabled));+ }+ });+ }++ /// The drag preview equals the committed `layer.moveTo` result and never touches the document or its history.+ #[test]+ fn preview_matches_real_move_and_never_edits_document_or_history() {+ let (mut s, ids) = new_session();+ let params = json!({"layer": ids[0].0, "target": ids[2].0, "position": "above"});+ let before = s.active().unwrap().doc.clone();+ let undo_before = s.active().unwrap().history.entries().len();+ let candidate = preview_move(&before, ¶ms, true).unwrap();+ assert_eq!(*before, *s.active().unwrap().doc);+ assert_eq!(s.active().unwrap().history.entries().len(), undo_before);+ s.execute("layer.moveTo", params).unwrap();+ assert_eq!(candidate, *s.active().unwrap().doc, "visual preview must match committed layer order");+ }++ /// A previewed ⌥-drag copy names its layers like the committed copy, with and without the "copy" suffix option.+ #[test]+ fn preview_copy_and_no_copy_suffix_option_match_committed_layers() {+ let (mut s, ids) = new_session();+ option(&mut s, "addCopyToCopiedLayersAndGroups", false);+ let params = json!({"layer": ids[0].0, "target": ids[2].0, "position": "below", "copy": true});+ let before = s.active().unwrap().doc.clone();+ let candidate = preview_move(&before, ¶ms, false).unwrap();+ s.execute("layer.moveTo", params).unwrap();+ let actual = &s.active().unwrap().doc;+ assert_eq!(candidate.layers.iter().map(|l| l.name.as_str()).collect::<Vec<_>>(), actual.layers.iter().map(|l| l.name.as_str()).collect::<Vec<_>>());+ assert_eq!(actual.layer_count(), before.layer_count() + 1);+ assert_eq!(actual.layers.iter().filter(|l| l.name == "Test 0").count(), 2);+ let d = s.execute("layer.duplicate", json!({"layer": ids[1].0})).unwrap();+ let duplicate = LayerId(d["layer"].as_u64().unwrap());+ assert_eq!(s.active().unwrap().doc.layer(duplicate).unwrap().name, "Test 1");+ option(&mut s, "addCopyToCopiedLayersAndGroups", true);+ let d = s.execute("layer.duplicate", json!({"layer": ids[1].0})).unwrap();+ assert!(s.active().unwrap().doc.layer(LayerId(d["layer"].as_u64().unwrap())).unwrap().name.contains("copy"));+ }++ /// Drops the command refuses (or ignores) give no preview and leave the document alone; a multi-layer preview follows the committed stack order.+ #[test]+ fn preview_rejects_invalid_drop_unchanged() {+ let (mut s, ids) = new_session();+ let before = s.active().unwrap().doc.clone();+ // Dropping a layer on itself is a no-op for the command, the others are errors.+ for (p, command_rejects) in [+ (json!({"layer": ids[1].0, "target": ids[1].0, "position": "above"}), false),+ (json!({"layer": ids[1].0, "target": 999999, "position": "below"}), true),+ (json!({"layer": ids[1].0, "target": ids[2].0, "position": "into"}), true),+ (json!({"layer": ids[1].0, "target": ids[2].0, "position": "invalid"}), true),+ ] {+ assert!(preview_move(&before, &p, true).is_none(), "{p}");+ let result = s.execute("layer.moveTo", p.clone());+ if command_rejects {+ assert!(result.is_err(), "{p}");+ } else {+ assert_eq!(result.unwrap(), Value::Null, "{p}");+ }+ assert_eq!(*before, *s.active().unwrap().doc, "{p}");+ }+ // Multi-layer preview and commit follow the same stack order regardless of params order.+ let p = json!({"layers": [ids[2].0, ids[0].0], "target": ids[1].0, "position": "below"});+ let candidate = preview_move(&before, &p, true).unwrap();+ s.execute("layer.moveTo", p).unwrap();+ assert_eq!(candidate, *s.active().unwrap().doc);+ }++ /// A 16×16 document holding `spec` (bottom to top, `*` = clipped) above its Background. Every+ /// layer is a translucent, differently placed rectangle, so the stack order and the clip+ /// groups both show in the composite.+ fn clip_stack(spec: &str) -> Session {+ let mut s = Session::new();+ s.execute("file.new", json!({"width": 16, "height": 16})).unwrap();+ for (n, name) in spec.split_whitespace().enumerate() {+ let id = LayerId(s.execute("layer.new.layer", json!({"name": name.trim_end_matches('*')})).unwrap()["layer"].as_u64().unwrap());+ let n = n as i32;+ let colour = [(n % 3) as f32 * 0.5, ((n + 1) % 3) as f32 * 0.5, ((n + 2) % 3) as f32 * 0.5, 0.6];+ s.edit("paint", |doc, _| {+ let layer = doc.layer_mut(id).unwrap();+ layer.clipped = name.ends_with('*');+ layer.surface_mut().unwrap().fill_rect(Rect::new(n * 2, 0, n * 2 + 10, 16), &colour);+ Ok(())+ })+ .unwrap();+ }+ s+ }++ /// Every layer of `doc` from the bottom, `*` marking the clipped ones.+ fn stack_text(doc: &Document) -> String {+ doc.layers.iter().map(|l| format!("{}{}", l.name, if l.clipped { "*" } else { "" })).collect::<Vec<_>>().join(" ")+ }++ /// The id of the layer called `name`, searching the whole layer tree.+ fn id_of(s: &Session, name: &str) -> u64 {+ s.active().unwrap().doc.walk().into_iter().find(|(_, _, l)| l.name == name).unwrap().2.id.0+ }++ /// The preview of `params` and the committed `layer.moveTo` show the same stack (names, clip+ /// flags) and the same composite, and both are `want`.+ fn assert_preview_is_commit(mut s: Session, params: Value, want: &str) {+ let before = s.active().unwrap().doc.clone();+ let preview = preview_move(&before, ¶ms, true).expect("the drop has a preview");+ s.execute("layer.moveTo", params.clone()).unwrap();+ let committed = &s.active().unwrap().doc;+ assert_eq!(stack_text(&preview), want, "preview of {params}");+ assert_eq!(stack_text(committed), want, "commit of {params}");+ assert_eq!(photocraft_compose::flatten(&preview).px, photocraft_compose::flatten(committed).px, "composite of {params}");+ }++ /// Previewed moves join and release clipping groups exactly as the committed reorder does, copies included.+ #[test]+ fn preview_follows_clip_groups_like_the_committed_reorder() {+ // The fixtures of `clip_group::reorder_joins_and_leaves_groups`.+ for (spec, layers, target, pos, want) in [+ // A layer dropped into a clip group joins it.+ ("B C1* C2* U", vec!["U"], "C1", "above", "Background B C1* U* C2*"),+ ("B C1* C2* U V", vec!["U", "V"], "C1", "above", "Background B C1* U* V* C2*"),+ // A clipped layer dropped off its group is released.+ ("B C1* C2* U", vec!["C1"], "U", "above", "Background B C2* U C1"),+ // A base moved away releases the layers clipped to it.+ ("B C1* C2* U", vec!["B"], "U", "above", "Background C1 C2 U B"),+ // A base moved up into its own group joins it, and the layers it left are released.+ ("B C1* C2*", vec!["B"], "C1", "above", "Background C1 B* C2"),+ ("X B C1* C2* U", vec!["B", "C1"], "U", "above", "Background X C2 U B C1*"),+ ] {+ let s = clip_stack(spec);+ let ids: Vec<u64> = layers.iter().map(|n| id_of(&s, n)).collect();+ let t = id_of(&s, target);+ assert_preview_is_commit(s, json!({"layers": ids, "target": t, "position": pos}), want);+ }+ // An option-drag copy joins the clip group it lands in too.+ let s = clip_stack("B C1* C2* U");+ let (u, c1) = (id_of(&s, "U"), id_of(&s, "C1"));+ assert_preview_is_commit(s, json!({"layer": u, "target": c1, "position": "above", "copy": true}), "Background B C1* U copy* C2* U");+ }++ /// Copying the locked Background in a preview gives the same unlocked copy, joining the clip group it lands in, as the command.+ #[test]+ fn preview_copies_the_background_like_the_committed_copy() {+ let mut s = clip_stack("A B*");+ let (bg, a) = (s.active().unwrap().doc.background().unwrap().id, id_of(&s, "A"));+ let before = s.active().unwrap().doc.clone();+ assert_ne!(before.layer(bg).unwrap().locks, Default::default(), "the Background is locked");+ let p = json!({"layer": bg.0, "target": a, "position": "above", "copy": true});+ let preview = preview_move(&before, &p, true).unwrap();+ s.execute("layer.moveTo", p).unwrap();+ let committed = &s.active().unwrap().doc;+ // The copy is an ordinary, unlocked layer that joins the clip group it lands in.+ assert_eq!(stack_text(committed), "Background A Background copy* B*");+ assert_eq!(stack_text(&preview), stack_text(committed));+ for doc in [&preview, committed] {+ assert_eq!(doc.layers.get(2).unwrap().locks, Default::default());+ assert!(doc.layers.first().unwrap().locks != Default::default());+ }+ assert_eq!(photocraft_compose::flatten(&preview).px, photocraft_compose::flatten(committed).px);+ }++ /// A drop that would move the Background off the bottom has no preview, as the command refuses it.+ #[test]+ fn preview_refuses_what_would_leave_the_background_off_the_bottom() {+ let mut s = clip_stack("A B");+ let (bg, a) = (s.active().unwrap().doc.background().unwrap().id, id_of(&s, "A"));+ let before = s.active().unwrap().doc.clone();+ for p in [+ json!({"layer": a, "target": bg.0, "position": "below"}),+ json!({"layer": bg.0, "target": bg.0, "position": "below", "copy": true}),+ json!({"layer": a, "target": bg.0, "position": "below", "copy": true}),+ ] {+ assert!(preview_move(&before, &p, true).is_none(), "{p}");+ assert!(s.execute("layer.moveTo", p.clone()).is_err(), "{p}");+ assert_eq!(*before, *s.active().unwrap().doc, "{p}");+ }+ }++ /// The UI runs commands through `start`; Expand New Effects applies there as well as to `execute`.+ #[test]+ fn expand_new_effects_applies_to_ui_start_dispatch_too() {+ let (mut s, ids) = new_session();+ option(&mut s, "expandNewEffects", false);+ let target = ids[0];+ let started = s.start("layer.layerStyle.dropShadow", json!({"layer": target.0})).unwrap();+ assert!(matches!(started, crate::jobs::Started::Done(_)));+ assert!(s.active().unwrap().fx_collapsed.contains(&target));+ }++ /// New Solid Color and Gradient fill layers get the default mask only while Use Default Masks on Fill Layers is on.+ #[test]+ fn fill_layers_respect_use_default_masks_option() {+ let (mut s, _) = new_session();+ option(&mut s, "useDefaultMasksOnFillLayers", false);+ let new = s.execute("layer.newFillLayer.solidColor", json!({"color": "#112233"})).unwrap();+ let id = LayerId(new["layer"].as_u64().unwrap());+ assert!(s.active().unwrap().doc.layer(id).unwrap().mask.is_none());+ option(&mut s, "useDefaultMasksOnFillLayers", true);+ let new = s.execute("layer.newFillLayer.gradient", json!({})).unwrap();+ let id = LayerId(new["layer"].as_u64().unwrap());+ assert!(s.active().unwrap().doc.layer(id).unwrap().mask.is_some());+ }++ /// With the option off only the default reveal-all mask goes away: an active selection still+ /// becomes the layer mask and an explicit path still becomes the vector mask (path first).+ #[test]+ fn fill_layers_without_default_masks_keep_selection_and_explicit_path_masks() {+ const KINDS: [(&str, &str); 3] = [+ ("layer.newFillLayer.solidColor", r##"{"color": "#112233"}"##),+ ("layer.newFillLayer.gradient", "{}"),+ ("layer.newFillLayer.pattern", r#"{"pattern": "Checkerboard"}"#),+ ];+ let path = json!({"subpaths": [{"closed": true, "knots": [[2, 2], [10, 2], [10, 10], [2, 10]]}]});+ let (mut s, _) = new_session();+ option(&mut s, "useDefaultMasksOnFillLayers", false);+ // Creates the fill layer; returns its raster mask and whether it has a vector mask.+ let create = |s: &mut Session, cmd: &str, params: &str, path: Option<&Value>| {+ let mut p: Value = serde_json::from_str(params).unwrap();+ if let Some(path) = path {+ p["path"] = path.clone();+ }+ let id = LayerId(s.execute(cmd, p).unwrap()["layer"].as_u64().unwrap());+ let l = s.active().unwrap().doc.layer(id).unwrap();+ (l.mask.clone(), l.vector_mask.is_some())+ };++ for (cmd, params) in KINDS {+ let (mask, vector) = create(&mut s, cmd, params, None);+ assert!(mask.is_none() && !vector, "{cmd}: no selection, no path: no mask at all");+ }++ s.execute("select.rect", json!({"x": 4, "y": 4, "width": 8, "height": 6})).unwrap();+ for (cmd, params) in KINDS {+ let (mask, vector) = create(&mut s, cmd, params, None);+ let mask = mask.unwrap_or_else(|| panic!("{cmd}: the selection still becomes the layer mask"));+ assert!(!vector, "{cmd}");+ assert!(mask.surface.pixel(6, 6)[0] > 0.99, "{cmd}: inside the selection reveals");+ assert!(mask.surface.pixel(20, 12)[0] < 0.01, "{cmd}: outside the selection hides");+ }++ // An explicit path wins over the selection, as with the option on.+ for selected in [true, false] {+ if !selected {+ s.execute("select.deselect", json!({})).unwrap();+ }+ for (cmd, params) in KINDS {+ let (mask, vector) = create(&mut s, cmd, params, Some(&path));+ assert!(vector, "{cmd}: the explicit path becomes the vector mask (selection: {selected})");+ assert!(mask.is_none(), "{cmd}: no raster mask next to the vector mask (selection: {selected})");+ }+ }+ }++ /// Whether new effects start expanded is view state: it adds no history step, and editing an existing effect keeps its disclosure.+ #[test]+ fn expand_new_effects_is_view_state_and_keeps_edit_history_clean() {+ let (mut s, ids) = new_session();+ option(&mut s, "expandNewEffects", false);+ let target = ids[0];+ let history = s.active().unwrap().history.entries().len();+ s.execute("layer.layerStyle.dropShadow", json!({"layer": target.0, "size": 2})).unwrap();+ assert_eq!(s.active().unwrap().history.entries().len(), history + 1);+ assert!(s.active().unwrap().fx_collapsed.contains(&target));+ option(&mut s, "expandNewEffects", true);+ let other = ids[1];+ s.execute("layer.layerStyle.stroke", json!({"layer": other.0, "size": 2})).unwrap();+ assert!(!s.active().unwrap().fx_collapsed.contains(&other));+ // Editing the existing effect must not unexpectedly change its disclosure.+ s.execute("layer.layerStyle.dropShadow", json!({"layer": target.0, "size": 5})).unwrap();+ assert!(s.active().unwrap().fx_collapsed.contains(&target));+ }++ /// The disclosure follows the layer the command changes, however the command names it: a+ /// layer given by name is not the active one.+ #[test]+ fn expand_new_effects_follows_a_layer_named_by_its_name() {+ let (mut s, ids) = new_session();+ option(&mut s, "expandNewEffects", false);+ let (named, active) = (ids[0], ids[2]);+ assert_eq!(s.active().unwrap().active_layer, Some(active));+ s.execute("layer.layerStyle.dropShadow", json!({"layer": "Test 0", "size": 2})).unwrap();+ assert!(s.active().unwrap().doc.layer(named).is_some_and(|l| !l.effects.items.is_empty()));+ assert!(s.active().unwrap().fx_collapsed.contains(&named), "the named layer's new effects start collapsed");+ assert!(!s.active().unwrap().fx_collapsed.contains(&active), "the active layer is not the one changed");+ }++ /// Transfer Effects changes the layer it moves the effects to, so that is the layer whose+ /// disclosure follows the option, not the active layer or the one the effects came from.+ #[test]+ fn expand_new_effects_follows_the_transfer_destination() {+ let (mut s, ids) = new_session();+ let (from, to, active) = (ids[0], ids[1], ids[2]);+ s.execute("layer.layerStyle.dropShadow", json!({"layer": from.0, "size": 2})).unwrap();+ option(&mut s, "expandNewEffects", false);+ assert_eq!(s.active().unwrap().active_layer, Some(active));+ s.execute("layer.layerStyle.transferEffects", json!({"from": from.0, "to": to.0, "copy": true})).unwrap();+ assert!(s.active().unwrap().doc.layer(to).is_some_and(|l| !l.effects.items.is_empty()));+ assert!(s.active().unwrap().fx_collapsed.contains(&to), "the destination's new effects start collapsed");+ assert!(!s.active().unwrap().fx_collapsed.contains(&active), "the active layer is not the one changed");+ }+}diff --cc docs/ui-parity.mdindex 4e496f60e,a21c9b84e..8ff3d40bf--- a/docs/ui-parity.md+++ b/docs/ui-parity.md@@@ -1,6 -1,6 +1,6 @@@# UI parity: tools, handles, modifiers and feel- > **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests) · **Target:** Adobe Photoshop 2026-> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-18 · **Change:** minor (Move tool: dragged selected pixels take their own outline as the selection, #7538; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed) · **Target:** Adobe Photoshop 2026++> **Last reviewed:** 2026-10-10 · **Last updated:** 2026-10-21 · **Change:** minor (Move tool: dragged selected pixels take their own outline as the selection, #7538; Animated Zoom: holding the Zoom tool zooms continuously, #6210; shape Density and Feather, TOOL-214-12, #5846; Pen Auto Add/Delete on the path being drawn, #6140; Show Transform Controls frames every selected layer; guide keys and clicks; menu bar from the keyboard, #4988; Crop tool Content-Aware Fill; on-canvas corner radius widgets, TOOL-214-12; Curvature Pen edits the active path; Clip Thumbnails to Layer Bounds; Pen ⇧ 45°; last selected tool restored at launch; Layers panel filter-type dropdown with Kind, Name and Mode, #5048; Free Transform box and marching ants follow the selection, #5297; History: the trash deletes the selected snapshot, rows drag onto the trash, #5324; smart filter reordering by drag; smart object perspective row corrected to done, #426; Free Transform H/V skew fields; toolbar tool shortcuts can be reassigned; ⇧-dragged guides land on ruler ticks; layer and selection keys; tool keys; spring-loaded tool letters; type formatting keys; Pen Auto Add/Delete, #4144; smart filter rows; stale missing-tool rows corrected: Color Replacement, Red Eye and the Add/Delete Anchor Point pair are live toolbar tools, Frame landed; no percentage changed; selection-modifier and ⌥-wheel rows match their tests) · **Target:** Adobe Photoshop 2026How PhotoCraft's direct manipulation compares with Photoshop 2026 (27.11.0): the toolbox, thehandles and modifier keys of each gesture, nudging, snapping, numeric precision, navigation,