Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed crashes caused by disconnected layer nodes #265

Merged
merged 1 commit into from
Sep 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Stitch/Graph/Node/Util/NodeDeletedAction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ extension GraphState {

layerNode[keyPath: x.keyPath.layerNodeKeyPath].canvasObserver = nil

// Remove conection
layerNode[keyPath: x.keyPath.layerNodeKeyPath].rowObserver.upstreamOutputCoordinate = nil

case .layerOutput(let x):
// Set the canvas-ui-data on the layer node's input = nil
guard let layerNode = self.getNodeViewModel(x.node)?.layerNode,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,10 @@ struct PreviewSidebarHighlightModifier: ViewModifier {
}

var isHighlighted: Bool {
highlightedSidebarLayers.contains(nodeId)
// TODO: reads here cause a crash nodes once connected to layer inputs nodes
/// https://github.com/StitchDesign/Stitch/issues/264
// highlightedSidebarLayers.contains(nodeId)
false
}

// Subtract out scale, so that line is always same width
Expand Down