From b36400f236e2bb730ff256848ebbdd6f67b77274 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Mon, 16 Nov 2026 00:54:04 -0800 Subject: [PATCH] Export for Screens: rows that take the top-level antiAlias are one file when their options match A format row's file key was made before the top-level `antiAlias` was added to its options, so a PDF row that sets no bleed and one that asks for the document's bleed wrote two identical files under Include Bleed. The key is now made again after the merge. --- crates/engine/src/cmd/fileio/screens.rs | 2 ++ crates/engine/src/cmd/fileio/tests_screens.rs | 3 +++ 2 files changed, 5 insertions(+) diff --git a/crates/engine/src/cmd/fileio/screens.rs b/crates/engine/src/cmd/fileio/screens.rs index 4762bca57f..d8ad60c47c 100644 --- a/crates/engine/src/cmd/fileio/screens.rs +++ b/crates/engine/src/cmd/fileio/screens.rs @@ -528,6 +528,8 @@ fn rows_of(s: &Session, p: &Value, preset: Option<&str>) -> Result> { if let Some(m) = r.options.as_object_mut() { m.entry("antiAlias").or_insert_with(|| aa.clone()); } + // Two rows whose options are now the same are one file. + r.key = r.file_key(); } } Ok(rows) diff --git a/crates/engine/src/cmd/fileio/tests_screens.rs b/crates/engine/src/cmd/fileio/tests_screens.rs index ccd9fd917c..e39b4fded7 100644 --- a/crates/engine/src/cmd/fileio/tests_screens.rs +++ b/crates/engine/src/cmd/fileio/tests_screens.rs @@ -641,6 +641,9 @@ fn include_bleed_pdf_pages_trim_at_the_artboard() { // A row that sets no bleed writes the same file as one that asks for the document's: one file. let r = export(&mut s, json!({"includeBleed": true, "artboard": 0, "formats": [{"format": "pdf"}, document]})); assert_eq!(names(&r).len(), 1, "{:?}", names(&r)); + // So does it with a top-level anti-aliasing mode, which both rows take. + let r = export(&mut s, json!({"includeBleed": true, "artboard": 0, "antiAlias": "art", "formats": [{"format": "pdf"}, document]})); + assert_eq!(names(&r).len(), 1, "{:?}", names(&r)); // A raster row of the same export still holds the bleed in its pixels. let r = export(&mut s, json!({"includeBleed": true, "artboard": 0, "formats": [document, {"format": "png"}]})); let png = files(&r).into_iter().find(|(n, _)| n.ends_with(".png")).unwrap().1;