From 6a84088dc8aa87e85abd32411a784dacc09e2725 Mon Sep 17 00:00:00 2001 From: dotCooCoo Date: Fri, 4 Dec 2026 17:22:41 -0800 Subject: [PATCH] Concept to Vector: insert results outside plug-in generated art An image inside a plug-in's generated art group took the variations as new members of that group, and the next Edit Generated Art redrew the group and deleted them. The group now counts as generated, so the results go beside it, as they do for the other generated groups. --- crates/engine/src/cmd/conceptvector.rs | 7 ++++--- crates/engine/src/concept_vector/tests.rs | 9 ++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/crates/engine/src/cmd/conceptvector.rs b/crates/engine/src/cmd/conceptvector.rs index 7977ee8253..10180b3fdd 100644 --- a/crates/engine/src/cmd/conceptvector.rs +++ b/crates/engine/src/cmd/conceptvector.rs @@ -164,11 +164,12 @@ fn shown_image_node(n: &Node) -> Option<&Node> { } /// Is `n` a group whose members are made or placed from data it holds (a graph, an Objects on -/// Path, Shaper, dimension, flare or Live Paint group, a compound shape), so that a member added -/// to it would be placed again, replaced or combined with the others? +/// Path, Shaper, dimension, flare or Live Paint group, a compound shape, a plug-in's generated +/// art), so that a member added to it would be placed again, replaced or combined with the others? fn generated(n: &Node) -> bool { let e = n.extras(); - e.graph.is_some() + e.generated.is_some() + || e.graph.is_some() || e.objects_on_path.is_some() || e.shaper.is_some() || e.dimension.is_some() diff --git a/crates/engine/src/concept_vector/tests.rs b/crates/engine/src/concept_vector/tests.rs index afc6698076..b53a0ab2f1 100644 --- a/crates/engine/src/concept_vector/tests.rs +++ b/crates/engine/src/concept_vector/tests.rs @@ -1077,13 +1077,16 @@ fn insert_puts_the_results_outside_a_live_paint_group() { assert!(*d.node(group).unwrap() == before, "the group is unchanged"); } -/// For an image in a graph, Shaper, dimension or flare group or a compound shape, the results go -/// beside the group, whose members stay as they are. +/// For an image in a graph, Shaper, dimension or flare group, a compound shape or a plug-in's +/// generated art, the results go beside the group, whose members stay as they are. #[test] fn insert_puts_the_results_outside_the_other_generated_groups() { use vectorcraft_doc::dimension::{Dimension, DimensionMode, DimensionOptions}; type Mark = fn(&mut Node); - let kinds: [(&str, Mark); 5] = [ + let kinds: [(&str, Mark); 6] = [ + ("plug-in generated art", |g| { + g.extras_mut().generated = Some(Box::new(vectorcraft_doc::generated::GeneratedArt::new("test.plugin", "Test", serde_json::Map::new()))); + }), ("graph", |g| g.extras_mut().graph = Some(Box::default())), ("Shaper", |g| g.extras_mut().shaper = Some(Box::default())), ("dimension", |g| {