PR #14413: the Include Background tests export Artboard Content Only

Red and Blue Board overlap in the test document. Include Overlapping Areas, the default since #14381, puts Blue Board's pixels on the Red Board page, so the tests, written before it, now ask for Artboard Content Only unless they set the content themselves.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
David MannandClaude Opus 5.5 committed 2026-11-21 19:18:53 +01:00
1 parent c9d5892806
commit e33b62659d
1 file changed
+5
@@ -38,6 +38,11 @@ fn export(s: &mut Session, tag: &str, params: Value) -> Vec<u8> {
let path = std::env::temp_dir().join(format!("photocraft-abpdf-bg-{}-{tag}.pdf", std::process::id()));
let mut p = params;
p["path"] = json!(path.to_string_lossy());
// Artboard Content Only unless a test says otherwise: Red and Blue Board overlap, and Include Overlapping Areas
// (#13646, the default) would put Blue Board's pixels on the Red Board page.
if p.get("content").is_none() {
p["content"] = json!("artboard");
}
s.execute("file.export.artboardsToPdf", p).unwrap();
let bytes = std::fs::read(&path).unwrap();
let _ = std::fs::remove_file(&path);