mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-01 18:54:31 +01:00
Scripts: explicit crop boxes, EPS close-with-save and writer receivers checked per call
- document.open with an explicit PDFCROPBOX crop opens on the crop box of a file with editing data; the default keeps the trim box and bleed. - Closing with save changes keeps an EPS document's artboard range, since the EPS file holds the whole document. - The script checker treats a writer receiver captured from an outer scope as able to change before each call, and finds the loop that holds a call with a binary search instead of a scan of every loop.
This commit is contained in:
1 parent
f99ef023ad
commit
82d4ec4336
6 files changed
+170
-7
No files matched your search
@@ -939,8 +939,12 @@ const SAVES_SOME_ARTBOARDS: &str =
|
||||
/// Whether the file that saving `st` with its remembered options writes would omit artboards. A
|
||||
/// PDF with `useArtboards: false` holds one page of the art's bounds. A native file, or a `.ai`
|
||||
/// file other than a legacy version 7 one, with `separateArtboards` holds every artboard, and its
|
||||
/// `range` names only the separate files.
|
||||
/// `range` names only the separate files. An EPS file embeds the whole document in its main file,
|
||||
/// so its `artboardRange` never omits an artboard from what reopens.
|
||||
fn picks_artboards(st: &crate::doc_state::DocState) -> bool {
|
||||
if st.format == "eps" {
|
||||
return false;
|
||||
}
|
||||
let options = Value::Object(crate::cmd::fileio::remembered_save_options(st));
|
||||
if matches!(st.format, "svg" | "svgz") && crate::cmd::fileio::svg_lost_artboards_warning(&st.doc, &options, st.format).is_some() {
|
||||
return true;
|
||||
|
||||
Reference in new issue
Block a user