mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-01 13:47:21 -06:00
Fix #4938: Dynamic symbols keep per-instance appearance linked to the symbol
This commit is contained in:
@@ -129,7 +129,7 @@ fn unused_images_are_pruned() {
|
||||
n.extras_mut().mask = Some(Box::new(OpacityMask::new(image_node(&mut d, "in mask"), false)));
|
||||
d.insert(Some(layer), 0, n).unwrap();
|
||||
let art = image_node(&mut d, "in symbol");
|
||||
d.symbols.push(Symbol { name: "S".into(), art: Arc::new(art) });
|
||||
d.symbols.push(Symbol { dynamic: false, name: "S".into(), art: Arc::new(art) });
|
||||
// Image objects inside foreign data (a brush library kept as JSON) keep theirs too.
|
||||
d.unknown.insert("brushes".into(), json!([{"art": {"type": "image", "key": "in brush"}}]));
|
||||
let back = load(&save(&d, true)).unwrap();
|
||||
|
||||
@@ -200,7 +200,7 @@ fn art_outside_the_layers_counts_too() {
|
||||
let mut art = paths_doc(1, anchors_for(1, 2 * PRETTY_MAX_BYTES));
|
||||
let path = Arc::clone(&art.layers[0]);
|
||||
art.layers.clear();
|
||||
d.symbols.push(Symbol { name: "Leaves".into(), art: path });
|
||||
d.symbols.push(Symbol { dynamic: false, name: "Leaves".into(), art: path });
|
||||
assert!(!SaveOptions::for_doc(&d).pretty);
|
||||
let bytes = save_file(&d);
|
||||
assert!(!is_pretty(&bytes));
|
||||
|
||||
Reference in New Issue
Block a user