Merge branch 'pr-14361' into pr-14321

# Conflicts:
#	crates/engine/src/cmd/artboard_cmds.rs
This commit is contained in:
David Mann committed 2026-11-21 18:48:28 +01:00
commit d44259eba2
2 files changed
+7 -3

No files matched your search

+5 -3
View File
@@ -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.
@@ -1061,7 +1061,9 @@ fn artboards_to_files(s: &mut Session, p: &Value) -> Result<Value> {
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()?;
@@ -1275,7 +1277,7 @@ pub fn specs() -> Vec<CommandSpec> {
"file.export.artboardsToPdf",
"Artboards to PDF…",
&["File", "Export"],
r##"{"path":str (.pdf),"artboards":[id]?,"quality":0..12=10,"reversePageOrder":bool=false (the default page order the other way round)} → {path, pages} (one raster page per board, bottom artboard of the Layers panel first)"##,
r##"{"path":str (.pdf),"artboards":[id]?,"quality":0..12=10,"reversePageOrder":bool=false (the default page order the other way round)} → {path, pages} (one raster page per board, bottom artboard of the Layers panel first)"##,
export_artboards,
artboards_to_pdf
),
@@ -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
}