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.
This commit is contained in:
dotCooCoo
2026-11-16 00:54:04 -08:00
parent 6eb973f8dd
commit b36400f236
2 changed files with 5 additions and 0 deletions
+2
View File
@@ -528,6 +528,8 @@ fn rows_of(s: &Session, p: &Value, preset: Option<&str>) -> Result<Vec<Row>> {
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)
@@ -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;