mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-29 01:34:29 +01:00
Scripts: visibility variables on embedded images, data sets kept after a no-op import
- variable.setBinding refuses an embedded image only for an image variable, so a script can bind an embedded image's visibility. - A Dataset object stays usable after dataset.import, variable.loadLibrary or variable.import leaves the document's data sets as they were, or the import is put back; it goes stale only when the data sets change. - script.check reports a document's exportVariables as filesWritten and file.write, and the script host test lists the variable and data set names the host adds. Docs: docs/mcp.md.
This commit is contained in:
1 parent
90752660ad
commit
6db0f6c1ad
10 files changed
+81
-13
No files matched your search
@@ -500,7 +500,7 @@ fn set_binding(s: &mut Session, p: &Value) -> Result<Value> {
|
||||
return Err(bad(C, format!("variable `{name}` is a {} variable, and this slot takes a {} variable", have.label(), kind.label())));
|
||||
}
|
||||
check_bindable(doc, &[id], kind, C)?;
|
||||
if matches!(doc.node(id).map(|n| &n.kind), Some(NodeKind::Image(im)) if im.link.is_none()) {
|
||||
if kind == VariableKind::Image && matches!(doc.node(id).map(|n| &n.kind), Some(NodeKind::Image(im)) if im.link.is_none()) {
|
||||
return Err(bad(C, format!("node {} is an embedded image, and an image variable drives only a linked image", id.0)));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user