mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-17 13:08:32 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user