mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user