3D and Materials: Expand as Wireframes expands an id given twice once

An object or layer named twice in ids is expanded once, so the selection holds only the edges that are in the document.
This commit is contained in:
dotCooCoo
2026-11-11 21:42:57 -08:00
parent d56e241a43
commit a90a803cfb
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -47,7 +47,12 @@ fn expand_as_wireframes(s: &mut Session, p: &Value) -> Result<Value> {
// they are.
let d = &s.doc()?.doc;
let mut wires = vec![];
let mut seen = std::collections::HashSet::new();
for id in roots {
// An id given twice is expanded once.
if !seen.insert(id) {
continue;
}
let Some(n) = d.node(id) else { continue };
if !effects::has_revolve(n) && !effects::has_solid(n) {
continue;
+2 -1
View File
@@ -71,7 +71,8 @@ fn a_layer_with_a_3d_effect_stays_a_layer_holding_the_edges() {
let layer = s.doc().unwrap().doc.layers[0].id;
s.execute("effect.apply", &json!({"ids":[layer.0],"effect":"threeD.extrude","item":null,"params":{}})).unwrap();
let history = undo_len(&s);
let out = run(&mut s, json!({"ids":[layer.0]})).unwrap();
// An id given twice is expanded once.
let out = run(&mut s, json!({"ids":[layer.0, layer.0]})).unwrap();
assert_eq!(out["ids"], json!([layer.0]));
let st = s.doc().unwrap();
let node = st.doc.node(layer).unwrap();