Browse Source

Fixed connection bug

flabbet 1 year ago
parent
commit
56d9e676a8

+ 1 - 0
src/PixiEditor.AvaloniaUI/Models/DocumentModels/Public/DocumentStructureModule.cs

@@ -62,6 +62,7 @@ internal class DocumentStructureModule
             throw new ArgumentException("Couldn't find child and parent");
         return (path[0], (IFolderHandler)path[1]);
     }
+    
     public List<IStructureMemberHandler> FindPath(Guid guid)
     {
         List<INodeHandler>? list = new List<INodeHandler>();

+ 5 - 0
src/PixiEditor.ChangeableDocument/Changeables/Graph/OutputProperty.cs

@@ -48,6 +48,11 @@ public class OutputProperty : IOutputProperty
     {
         if (Connections.Contains(property)) return;
 
+        if (property.Connection != null)
+        {
+            property.Connection.DisconnectFrom(property);
+        }
+        
         _connections.Add(property);
         property.Connection = this;
         Connected?.Invoke(property, this);