From f9b4e677c4bf5ae3ecce714a688852e383dfdf7d Mon Sep 17 00:00:00 2001 From: David Mann Date: Fri, 30 Oct 2026 19:14:28 +0100 Subject: [PATCH] Tests: Rasterize Layer Style keeps a tagged CMYK document's inks (#4035) #4035's only code change makes Rasterize Layer Style separate its RGB bake through the document's own CMYK profile, but none of its tests ran that command (they cover Flatten, Stamp and Merge, which already worked), so removing the change left every test green. New test: a tagged CMYK document's layer gets a drop shadow that falls off the canvas and is rasterized; the inks must come back within the profile's round trip. Without #4035's change they move by 35 levels (0.137) and the test fails; with it they pass at 8 and 16 bits. Co-Authored-By: Claude Opus 5.5 --- crates/engine/tests/cmyk_flatten_profile.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/crates/engine/tests/cmyk_flatten_profile.rs b/crates/engine/tests/cmyk_flatten_profile.rs index 28b3bf9afc..41739f5326 100644 --- a/crates/engine/tests/cmyk_flatten_profile.rs +++ b/crates/engine/tests/cmyk_flatten_profile.rs @@ -174,3 +174,19 @@ fn merge_visible_separates_through_the_document_profile() { assert!(d <= ROUND_TRIP, "{depth}-bit Merge Visible: inks moved by {d}"); } } + +/// Rasterize Layer Style bakes the layer through the RGB composite and separates the result +/// back: through the document's profile, the one the layer was read with (#3778), so the inks +/// under the effect-free area come back within the profile's round trip. The drop shadow falls +/// off the canvas, so every pixel checked is the layer's own. +#[test] +fn rasterize_layer_style_separates_through_the_document_profile() { + for depth in [8, 16] { + let d = drift(depth, true, 0, |s| { + s.execute("layer.new.layerFromBackground", json!({})).unwrap(); + s.execute("layer.layerStyle.dropShadow", json!({"distance": 40, "size": 0})).unwrap(); + s.execute("layer.rasterize.layerStyle", json!({})).unwrap(); + }); + assert!(d <= ROUND_TRIP, "{depth}-bit Rasterize Layer Style: inks moved by {d}"); + } +}