Skip to content

Commit f558712

Browse files
0HyperCubeKeavon
authored andcommitted
Ignore hidden path nodes
1 parent e6f1ad9 commit f558712

3 files changed

Lines changed: 9 additions & 2 deletions

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ impl DocumentMetadata {
9090

9191
let mut use_local = true;
9292
let graph_layer = graph_modification_utils::NodeGraphLayer::new(layer, network_interface);
93-
if let Some(path_node) = graph_layer.upstream_node_id_from_name("Path") {
93+
if let Some(path_node) = graph_layer.upstream_visible_node_id_from_name("Path") {
9494
if let Some(&source) = self.first_instance_source_ids.get(&layer.to_node()) {
9595
if !network_interface
9696
.upstream_flow_back_from_nodes(vec![path_node], &[], FlowType::HorizontalFlow)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3445,7 +3445,7 @@ impl NodeNetworkInterface {
34453445
pub fn compute_modified_vector(&self, layer: LayerNodeIdentifier) -> Option<VectorData> {
34463446
let graph_layer = graph_modification_utils::NodeGraphLayer::new(layer, self);
34473447

3448-
if let Some(vector_data) = graph_layer.upstream_node_id_from_name("Path").and_then(|node| self.document_metadata.vector_modify.get(&node)) {
3448+
if let Some(vector_data) = graph_layer.upstream_visible_node_id_from_name("Path").and_then(|node| self.document_metadata.vector_modify.get(&node)) {
34493449
let mut modified = vector_data.clone();
34503450
if let Some(TaggedValue::VectorModification(modification)) = graph_layer.find_input("Path", 1) {
34513451
modification.apply(&mut modified);

editor/src/messages/tool/common_functionality/graph_modification_utils.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,13 @@ impl<'a> NodeGraphLayer<'a> {
424424
.find(|node_id| self.network_interface.reference(node_id, &[]).is_some_and(|reference| *reference == Some(node_name.to_string())))
425425
}
426426

427+
/// Node id of a visible node if it exists in the layer's primary flow
428+
pub fn upstream_visible_node_id_from_name(&self, node_name: &str) -> Option<NodeId> {
429+
self.horizontal_layer_flow()
430+
.filter(|node_id| self.network_interface.is_visible(node_id, &[]))
431+
.find(|node_id| self.network_interface.reference(node_id, &[]).is_some_and(|reference| *reference == Some(node_name.to_string())))
432+
}
433+
427434
/// Node id of a protonode if it exists in the layer's primary flow
428435
pub fn upstream_node_id_from_protonode(&self, protonode_identifier: ProtoNodeIdentifier) -> Option<NodeId> {
429436
self.horizontal_layer_flow()

0 commit comments

Comments
 (0)