diff --git a/crates/engine/src/cmd/artboard_cmds.rs b/crates/engine/src/cmd/artboard_cmds.rs index 746a2da111..649a328407 100644 --- a/crates/engine/src/cmd/artboard_cmds.rs +++ b/crates/engine/src/cmd/artboard_cmds.rs @@ -16,7 +16,7 @@ use photocraft_raster::Surface; use serde_json::{Value, json}; use crate::commands::{CommandSpec, color_param, int, int_i32, parse_hex}; -use crate::file_cmds::{SaveOpts, encode, f64_param, join, native_doc, sanitize, stem, str_param, write_file}; +use crate::file_cmds::{encode, f64_param, join, native_doc, sanitize, stem, str_param, write_file}; use crate::{EngineError, Result, Session}; /// Artboard size presets (name, width, height) in pixels, Photoshop's common devices and pages. @@ -1076,7 +1076,9 @@ fn artboards_to_files(s: &mut Session, p: &Value) -> Result { Some(_) if truecolour && one.mode != ColorMode::Rgb => encode(&rgb_copy(&one)?, &path, save)?, Some(_) => encode(&one, &path, save)?, // The PNG-8 writer does not interlace; say so, as the palette PNG path of a save does. - None if save.png_interlaced == Some(true) => (png8(&one, cmd)?, vec!["written without interlacing: the PNG-8 exporter does not interlace".to_owned()]), + None if save.png_interlaced == Some(true) => { + (png8(&one, cmd)?, vec!["written without interlacing: the PNG-8 exporter does not interlace".to_owned()]) + } None => (png8(&one, cmd)?, Vec::new()), }; guard.check()?; @@ -1458,11 +1460,11 @@ mod file_types_tests; #[path = "artboard_cmds/first_board_background_tests.rs"] mod first_board_background_tests; #[cfg(test)] -#[path = "artboard_cmds/include_name_tests.rs"] -mod include_name_tests; -#[cfg(test)] #[path = "artboard_cmds/from_group_reset_props_tests.rs"] mod from_group_reset_props_tests; +#[cfg(test)] +#[path = "artboard_cmds/include_name_tests.rs"] +mod include_name_tests; #[cfg(test)] #[path = "artboard_cmds/from_layers_history_name_tests.rs"] diff --git a/crates/engine/src/cmd/artboard_cmds/pdf_include_background_tests.rs b/crates/engine/src/cmd/artboard_cmds/pdf_include_background_tests.rs index 6d359b58a9..cf9d883e73 100644 --- a/crates/engine/src/cmd/artboard_cmds/pdf_include_background_tests.rs +++ b/crates/engine/src/cmd/artboard_cmds/pdf_include_background_tests.rs @@ -38,6 +38,11 @@ fn export(s: &mut Session, tag: &str, params: Value) -> Vec { 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); diff --git a/crates/ui-egui/src/artboards_to_pdf_reverse_tests.rs b/crates/ui-egui/src/artboards_to_pdf_reverse_tests.rs index ebc7371bb7..50c0e480fe 100644 --- a/crates/ui-egui/src/artboards_to_pdf_reverse_tests.rs +++ b/crates/ui-egui/src/artboards_to_pdf_reverse_tests.rs @@ -35,6 +35,8 @@ fn open(h: &mut H, path: &str) -> DialogId { let dialog = h.state().framework.dialogs.open_dialogs().into_iter().map(|d| d.id).find(|d| d.value().to_string() == want).unwrap(); h.run_steps(4); h.state_mut().framework.dialogs.set_json_field(&ctx, dialog, "path", json!(path)).unwrap(); + // Every board, not only the selected one: Export Selected Artboards opens ticked while a board is selected (#13647). + h.state_mut().framework.dialogs.set_json_field(&ctx, dialog, "artboards", serde_json::Value::Null).unwrap(); h.run_steps(4); dialog } diff --git a/crates/ui-egui/src/menus/view_cmds/dialogs.rs b/crates/ui-egui/src/menus/view_cmds/dialogs.rs index 05c4c86159..ddb5005730 100644 --- a/crates/ui-egui/src/menus/view_cmds/dialogs.rs +++ b/crates/ui-egui/src/menus/view_cmds/dialogs.rs @@ -322,10 +322,15 @@ pub(super) fn params_for(app: &mut PhotocraftApp, id: &str) -> Option<(Vec {