Skip to content

VectorCraft: An open-source, vector art tool written by scratch in pure Rust

Export for Screens: a per-artboard EPS takes the artboard as its page, so an empty artboard still writes

bflatastic9f1a001a2bdd
diff --git a/crates/engine/src/cmd/fileio/screens.rs b/crates/engine/src/cmd/fileio/screens.rs
index 28c3358ca..1d9c0303c 100644
--- a/crates/engine/src/cmd/fileio/screens.rs
+++ b/crates/engine/src/cmd/fileio/screens.rs
@@ -793,7 +793,12 @@ fn encode_and_write(export: ScreenExport, writer: &mut dyn FnMut(&str, &[u8]) ->
Arc::new(d)
})
.clone();
- write(&d, r.format.id, &r.options_for(item.region, None)?)?
+ let mut options = r.options_for(item.region, None)?;
+ // An EPS page is the artboard, not its art's bounds: an artboard without art still writes.
+ if r.format.id == "eps" {
+ options["useArtboards"] = json!(true);
+ }
+ write(&d, r.format.id, &options)?
} else {
write(&item.doc, r.format.id, &r.options_for(item.region, item.artboard)?)?
};