mirror of
https://github.com/storytold/figcraft.git
synced 2026-10-25 10:56:48 -06:00
#627: settle bound paints once per open, not also in the native loader
DocState::new already settles every opened document (native files, branches and live joins included); the .fig/REST path keeps its settlement in link_instances for file.import into an open document.
This commit is contained in:
@@ -520,7 +520,6 @@ fn load_with(
|
||||
if loaded.doc.name.is_empty() {
|
||||
loaded.doc.name = file_stem(name_hint);
|
||||
}
|
||||
super::styles::apply_paint_bindings_on_load(&mut loaded.doc);
|
||||
Ok((loaded, false))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,7 +53,10 @@ fn initial_color_bindings_settle_in_constructor_and_loaders() {
|
||||
|
||||
let native = figcraft_format::save_bytes(&stale, None).unwrap();
|
||||
let (loaded, _) = crate::cmd::file::load_bytes(&native, "bindings.figcraft").unwrap();
|
||||
let loaded_id = assert_dark_bound_color(&loaded, name_transform);
|
||||
// A native file settles when it opens as a document, not in the loader.
|
||||
let opened = Session::with_document(loaded);
|
||||
let loaded = opened.doc().unwrap();
|
||||
let loaded_id = assert_dark_bound_color(loaded, name_transform);
|
||||
assert_eq!(loaded_id, id);
|
||||
assert_eq!(loaded.node(id).unwrap().source, stale.first_page());
|
||||
assert!(loaded.node(id).unwrap().overrides.contains("sentinel"));
|
||||
|
||||
Reference in New Issue
Block a user