Add artboard name to the export when exporting a single artboard (#3613)

* add artboard name to the export

* change file name to {docname}-{artboard} for more than 1 arboard

* add switch statement instead of if else
This commit is contained in:
Ayush Amawate
2026-01-11 17:58:19 +05:30
committed by GitHub
parent 1b91198b28
commit d98f19bf4a
5 changed files with 30 additions and 8 deletions

View File

@@ -242,6 +242,8 @@ impl NodeGraphExecutor {
scale_factor,
#[cfg(feature = "gpu")]
transparent_background,
artboard_name,
artboard_count,
..
} = export_config;
@@ -250,7 +252,11 @@ impl NodeGraphExecutor {
FileType::Png => "png",
FileType::Jpg => "jpg",
};
let name = format!("{name}.{file_extension}");
let base_name = match (artboard_name, artboard_count) {
(Some(artboard_name), count) if count > 1 => format!("{name} - {artboard_name}"),
_ => name,
};
let name = format!("{base_name}.{file_extension}");
match node_graph_output {
TaggedValue::RenderOutput(RenderOutput {