PhotoCraft: An open-source, photo editor written by scratch in pure Rust
Merge PR #6002: Stroke: keep Overprint (overprint)
David Mann86811ddeeec9
diff --cc crates/engine/src/layer_style.rsindex 75f07820e,625aef44e..9020e5503--- a/crates/engine/src/layer_style.rs+++ b/crates/engine/src/layer_style.rs@@@ -1146,17 -1146,17 +1148,28 @@@ mod testsassert_eq!((t.name.as_str(), t.depth, t.invert), ("Bubbles", -2.0, true));}+ #[test]+ fn bevel_gloss_anti_alias_is_a_param() {+ let mut s = session();+ s.execute("layer.layerStyle.bevelEmboss", json!({"glossContour": "Ring - Double", "glossAntiAlias": true})).unwrap();+ let Effect::BevelEmboss(b) = &effects(&s)[0] else { panic!() };+ assert!(b.gloss_anti_alias);+ s.execute("layer.layerStyle.bevelEmboss", json!({"glossAntiAlias": false})).unwrap();+ let Effect::BevelEmboss(b) = &effects(&s)[0] else { panic!() };+ assert!(!b.gloss_anti_alias);+ }++ #[test]+ fn stroke_overprint_is_a_param() {+ let mut s = session();+ s.execute("layer.layerStyle.stroke", json!({"size": 4, "overprint": true})).unwrap();+ let Effect::Stroke(st) = &effects(&s)[0] else { panic!() };+ assert!(st.overprint);+ s.execute("layer.layerStyle.stroke", json!({"overprint": false})).unwrap();+ let Effect::Stroke(st) = &effects(&s)[0] else { panic!() };+ assert!(!st.overprint);+ }+#[test]fn every_style_command_adds_its_effect() {for kind in ["dropShadow", "innerShadow", "outerGlow", "innerGlow", "stroke", "colorOverlay", "gradientOverlay", "bevelEmboss", "satin"] {diff --cc crates/ui-egui/src/layer_style.rsindex 1e8402b78,9d355c3fb..9b2f3a06e--- a/crates/ui-egui/src/layer_style.rs+++ b/crates/ui-egui/src/layer_style.rs@@@ -1635,24 -1636,22 +1637,40 @@@ mod tests);}+ #[test]+ fn bevel_gloss_anti_alias_survives_the_dialog() {+ let mut s = session();+ s.execute("layer.layerStyle.bevelEmboss", json!({"glossContour": "Ring - Double", "glossAntiAlias": true})).unwrap();+ let st = s.active().unwrap();+ let id = st.active_layer.unwrap();+ let mut f = initial_fields(st.doc.layer(id).unwrap(), None, st.doc.global_light.angle);+ assert_eq!(effects_of(&f)[0]["params"]["glossAntiAlias"], json!(true));+ // Editing another setting keeps the gloss contour's Anti-aliased.+ set_param(&mut f, "fx1", "size", json!(12));+ apply(&f, |cmd, p| s.execute(cmd, p).map_err(|e| e.to_string())).unwrap();+ let st = s.active().unwrap();+ let items = &st.doc.layer(id).unwrap().effects.items;+ let Some(photocraft_doc::Effect::BevelEmboss(b)) = items.first() else { panic!("{items:?}") };+ assert_eq!(b.size, 12.0);+ assert!(b.gloss_anti_alias);+ }++ #[test]+ fn stroke_overprint_survives_the_dialog() {+ let mut s = session();+ s.execute("layer.layerStyle.stroke", json!({"size": 3, "color": "#000000", "overprint": true})).unwrap();+ let st = s.active().unwrap();+ let id = st.active_layer.unwrap();+ let mut f = initial_fields(st.doc.layer(id).unwrap(), None, st.doc.global_light.angle);+ assert_eq!(effects_of(&f)[0]["params"]["overprint"], json!(true));+ // Editing another setting keeps Overprint.+ set_param(&mut f, "fx1", "size", json!(5));+ apply(&f, |cmd, p| s.execute(cmd, p).map_err(|e| e.to_string())).unwrap();+ let strokes = strokes_of(&s);+ assert_eq!(strokes[0].size, 5.0);+ assert!(strokes[0].overprint);+ }+#[test]fn preview_applies_the_style_without_touching_the_document() {let s = session();diff --cc docs/file-format-parity.mdindex 86694f018,ada1a89e4..b0ee2ad60--- a/docs/file-format-parity.md+++ b/docs/file-format-parity.md@@@ -145,7 -145,7 +145,8 @@@ remaining gaps in #1606 stay tracked wi| 2026-10-15 | minor | DDS textures save (#1327): uncompressed or BC1/BC2/BC3 (DXT1/3/5) from a clean-room block encoder, optional box-filtered mip chain, legacy header; DDS Options in Save As and Save a Copy, `ddsCompression`/`ddsMipmaps` for scripts, the CLI and MCP || 2026-10-15 | minor | PNG: a stereo PNG's `sTER` pairing (PNG Extensions 1.4.0 §3.6) is read on open and written back on save, so the file still says it is a stereo pair (#6063) || 2026-10-15 | minor | PSD guides: image resource 1092 (guides v2) gives guides their own colours on import; 1092 and 1097 (guide GUIDs) are written back only while they still describe the document's guides, so an edit no longer leaves Photoshop a stale second guide list (#5966) |+| 2026-10-15 | minor | Bevel & Emboss Gloss Contour › Anti-aliased (`antialiasGloss`) is read and written, set by `glossAntiAlias` and shown in the Layer Style dialog; a PSD whose bevel is edited no longer loses it. Rendering still ignores contour anti-aliasing, as for the other effects' contours |+ | 2026-10-15 | minor | Stroke › Overprint (`overprint`) is read and written, set by the stroke command's `overprint` and shown in the Layer Style dialog; an edited stroke no longer drops it. Rendering ignores it for now || 2026-10-14 | minor | PSD smart filter masks: Photoshop stores a smart object's filtered pixels without its filter mask and mixes the unfiltered ones (`FEid`) back in; import now mixes them and export writes them that way, so sf-filter-mask-hard, -gradient and sf-stack-blend-and-mask pass; Photoshop-oracle floor 185 → 188 of 258 || 2026-10-13 | minor | Lossy DNG (compression 34892) decodes: 8-bit baseline JPEG tiles and strips, CFA and LinearRaw, partial edge tiles; the stored values take the normal levels and LinearizationTable (FILE-215-11, lossy DNG part) || 2026-10-14 | minor | Corpus floors raised to the measured results of the CMYK, Lab, 32-bit, Levels, Threshold, Posterize, feather and pass-through fixes landed together: Photoshop-authored 165 → 185 of 258, io 146 → 148 of 170, psd-tools 242 → 249 of 309 |