Skip to content

Node graph connection to export in wrong place #4279

Description

@0HyperCube

Reproduction

  • New document
  • Create rectangle
  • Open node graph and pan so the export is at the top of the screen
  • Preview the fill node
  • Wires in wrong place
incorrect_line_when_previewing.mp4

Fix

This can also occur if you directly connect the fill node to the output (not using the preview feature).

diff --git a/editor/src/messages/portfolio/document/utility_types/network_interface.rs b/editor/src/messages/portfolio/document/utility_types/network_interface.rs
index 0ac69d677..ca3902bac 100644
--- a/editor/src/messages/portfolio/document/utility_types/network_interface.rs
+++ b/editor/src/messages/portfolio/document/utility_types/network_interface.rs
@@ -4239,6 +4239,10 @@ impl NodeNetworkInterface {
 					}
 					NodeTypePersistentMetadata::Node(_) => {}
 				}
+				// Altering an export may move the connectors meaning the ports must be refreshed. See issue #4279.
+				if matches!(input_connector, InputConnector::Export(_)) {
+					self.unload_import_export_ports(network_path)
+				}
 				self.unload_upstream_node_click_targets(vec![*upstream_node_id], network_path);
 				self.unload_stack_dependents(network_path);
 				self.try_set_upstream_to_chain(input_connector, network_path);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions