|
pub fn compute_modified_vector(&self, layer: LayerNodeIdentifier) -> Option<Vector> { |
|
let graph_layer = graph_modification_utils::NodeGraphLayer::new(layer, self); |
|
|
|
if let Some(path_node) = graph_layer.upstream_visible_node_id_from_name_in_layer("Path") |
|
&& let Some(vector) = self.document_metadata.vector_modify.get(&path_node) |
|
{ |
|
let mut modified = vector.clone(); |
|
|
|
let path_node = self.document_network().nodes.get(&path_node); |
|
let modification_input = path_node.and_then(|node: &DocumentNode| node.inputs.get(1)).and_then(|input| input.as_value()); |
|
if let Some(TaggedValue::VectorModification(modification)) = modification_input { |
|
modification.apply(&mut modified); |
|
} |
|
return Some(modified); |
|
} |
|
|
|
self.document_metadata |
|
.click_targets |
|
.get(&layer) |
|
.map(|click| click.iter().map(ClickTarget::target_type)) |
|
.map(|target_types| Vector::from_target_types(target_types, true)) |
|
} |
It tries to get a path node and then falls back on the document_metadata.click_targets. SegmentIds are not stored in the click targets. Therefore this code will just incorrectly assume incremental SegmentIds (the actual generation of SegmentIds occurs inside Vector::from_target_types in vector.append_subpath).
This means that trying to delete a segment or modify a handle when the SegmentIds are not contiguous (e.g. after a boolean operation) will result in confusing results (targeting the wrong segment or no segment at all). From this Discord report.
See reproduction steps: #3481 (comment)
Graphite/editor/src/messages/portfolio/document/utility_types/network_interface.rs
Lines 3047 to 3068 in b4fc3d0
It tries to get a path node and then falls back on the
document_metadata.click_targets.SegmentIds are not stored in the click targets. Therefore this code will just incorrectly assume incrementalSegmentIds (the actual generation ofSegmentIds occurs insideVector::from_target_typesinvector.append_subpath).This means that trying to delete a segment or modify a handle when the
SegmentIds are not contiguous (e.g. after a boolean operation) will result in confusing results (targeting the wrong segment or no segment at all). From this Discord report.See reproduction steps: #3481 (comment)