Fix #4938: Dynamic symbols keep per-instance appearance linked to the symbol

This commit is contained in:
bflatastic
2026-11-01 04:53:38 +07:00
parent 3f1928efc8
commit f22caa6108
105 changed files with 1218 additions and 212 deletions
+1 -1
View File
@@ -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();
+1 -1
View File
@@ -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));