mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-12-05 13:32:45 -05:00
Print: keep the branch to Print as Bitmap's resolution
- The print option classes list their members in reflect as #9060 lists them; the rule that left out unmapped options came from an earlier merge of main and is not part of this change. - Document.tags keeps its place after print in the Document members, as on main.
This commit is contained in:
1 parent
6d175f9e64
commit
80a3f65798
3 files changed
+2
-18
No files matched your search
@@ -3106,9 +3106,9 @@ fn classes(link: &Link) -> Vec<HostClass> {
|
||||
document.extend(text::styles::doc_members(l));
|
||||
document.extend(["layers", "artboards", "groupItems", "swatches", "symbols", "activeLayer"].into_iter().map(|m| later(l, "Document", m)));
|
||||
document.extend(variables::document_members(l));
|
||||
document.push(("tags".into(), get(l, tags::doc_tags), MemberInfo { collection: true, ..typed("Tags") }));
|
||||
document.extend(save_open::document_members(l));
|
||||
document.extend(print::document_members(l));
|
||||
document.push(("tags".into(), get(l, tags::doc_tags), MemberInfo { collection: true, ..typed("Tags") }));
|
||||
classes.push(class("Document", None, document, None));
|
||||
classes.push(class(
|
||||
"Views",
|
||||
|
||||
@@ -1238,11 +1238,7 @@ pub(super) fn classes(link: &Link) -> Vec<HostClass> {
|
||||
create(&h, index)
|
||||
});
|
||||
let mut members = vec![("typename".to_string(), super::typename_of(c.name), typed("string"))];
|
||||
// `reflect` leaves out a property that is not mapped: it takes only its default.
|
||||
members.extend(c.fields.iter().enumerate().map(|(i, field)| {
|
||||
let info = MemberInfo { unavailable: !field.mapped, ..field_info(field) };
|
||||
(field.name.to_string(), property(link, index, i), info)
|
||||
}));
|
||||
members.extend(c.fields.iter().enumerate().map(|(i, field)| (field.name.to_string(), property(link, index, i), field_info(field))));
|
||||
HostClass { construct: Some(construct), ..class(c.name, None, members, None) }
|
||||
})
|
||||
.collect();
|
||||
|
||||
@@ -684,18 +684,6 @@ fn options_that_are_not_available_throw() {
|
||||
let _ = std::fs::remove_dir_all(base);
|
||||
}
|
||||
|
||||
/// `reflect` lists the options a script can set and leaves out the ones that take only their default.
|
||||
#[test]
|
||||
fn reflect_leaves_out_options_that_are_not_available() {
|
||||
let base = folder("reflect");
|
||||
let mut s = session(&base);
|
||||
let script = "var o = new PrintOptions(), j = new PrintJobOptions(); \
|
||||
vc.log(String(o.reflect.find('printerName'))); vc.log(String(j.reflect.find('name'))); \
|
||||
vc.log(String(o.reflect.find('printPreset') != null)); vc.log(String(j.reflect.find('copies') != null));";
|
||||
assert_eq!(logged(&mut s, &base, script), json!(["null", "null", "true", "true"]));
|
||||
let _ = std::fs::remove_dir_all(base);
|
||||
}
|
||||
|
||||
/// A panic while `print` has the fence open for `file.print` closes it again for the next run.
|
||||
#[test]
|
||||
fn a_panic_while_printing_leaves_the_fence_closed() {
|
||||
|
||||
Reference in new issue
Block a user