Skip to content

Commit ba2513d

Browse files
committed
Use Arc<Vector> in vector_data for regression
1 parent 92d5293 commit ba2513d

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

editor/src/messages/portfolio/document/document_message.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ pub enum DocumentMessage {
211211
clip_targets: HashSet<NodeId>,
212212
},
213213
UpdateVectorData {
214-
vector_data: HashMap<NodeId, Vector>,
214+
vector_data: HashMap<NodeId, Arc<Vector>>,
215215
},
216216
Undo,
217217
UngroupSelectedLayers,

editor/src/messages/portfolio/document/utility_types/document_metadata.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ pub struct DocumentMetadata {
3232
pub vector_modify: HashMap<NodeId, Vector>,
3333
/// Vector data keyed by layer ID, used as fallback when no Path node exists.
3434
/// This provides accurate SegmentIds for layers without explicit Path nodes.
35-
pub layer_vector_data: HashMap<LayerNodeIdentifier, Vector>,
35+
pub layer_vector_data: HashMap<LayerNodeIdentifier, Arc<Vector>>,
3636
/// Transform from document space to viewport space.
3737
pub document_to_viewport: DAffine2,
3838
}

editor/src/messages/portfolio/document/utility_types/network_interface.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3076,7 +3076,7 @@ impl NodeNetworkInterface {
30763076
return Some(modified);
30773077
}
30783078

3079-
self.document_metadata.layer_vector_data.get(&layer).cloned()
3079+
self.document_metadata.layer_vector_data.get(&layer).map(|arc| arc.as_ref().clone())
30803080
}
30813081

30823082
/// Loads the structure of layer nodes from a node graph.
@@ -3192,7 +3192,7 @@ impl NodeNetworkInterface {
31923192
}
31933193

31943194
/// Update the layer vector data (for layers without Path nodes)
3195-
pub fn update_vector_data(&mut self, new_layer_vector_data: HashMap<LayerNodeIdentifier, Vector>) {
3195+
pub fn update_vector_data(&mut self, new_layer_vector_data: HashMap<LayerNodeIdentifier, Arc<Vector>>) {
31963196
self.document_metadata.layer_vector_data = new_layer_vector_data;
31973197
}
31983198
}

node-graph/libraries/rendering/src/renderer.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ pub struct RenderMetadata {
249249
pub first_element_source_id: HashMap<NodeId, Option<NodeId>>,
250250
pub click_targets: HashMap<NodeId, Vec<Arc<ClickTarget>>>,
251251
pub clip_targets: HashSet<NodeId>,
252-
pub vector_data: HashMap<NodeId, Vector>,
252+
pub vector_data: HashMap<NodeId, Arc<Vector>>,
253253
}
254254

255255
impl RenderMetadata {
@@ -1189,7 +1189,7 @@ impl Render for Table<Vector> {
11891189

11901190
metadata.click_targets.entry(element_id).or_insert(click_targets);
11911191
// Store the full vector data including segment IDs for accurate segment modification
1192-
metadata.vector_data.entry(element_id).or_insert_with(|| vector.clone());
1192+
metadata.vector_data.entry(element_id).or_insert_with(|| Arc::new(vector.clone()));
11931193
}
11941194

11951195
if let Some(upstream_nested_layers) = &vector.upstream_data {

0 commit comments

Comments
 (0)