瀏覽代碼

fixing frame port refresh bug

Pamela Wolf 4 年之前
父節點
當前提交
a8a01fbd48
共有 2 個文件被更改,包括 12 次插入4 次删除
  1. 4 4
      nodeEditor/src/diagram/graphFrame.ts
  2. 8 0
      nodeEditor/src/diagram/graphNode.ts

+ 4 - 4
nodeEditor/src/diagram/graphFrame.ts

@@ -225,7 +225,7 @@ export class GraphFrame {
                     portAdded = true;
                     const onLinkDisposedObserver = link.onDisposedObservable.add((nodeLink: NodeLink) => {
                         this.removePortFromExposedWithLink(nodeLink, this._exposedInPorts);
-                        this._redrawFramePorts();
+                        this.redrawFramePorts();
                     });
                     this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver);
                 }
@@ -255,7 +255,7 @@ export class GraphFrame {
 
                         const onLinkDisposedObserver = link.onDisposedObservable.add((nodeLink: NodeLink) => {
                             this.removePortFromExposedWithLink(nodeLink, this._exposedOutPorts);
-                            this._redrawFramePorts();
+                            this.redrawFramePorts();
                         });
 
                         this._onNodeLinkDisposedObservers.push(onLinkDisposedObserver); 
@@ -291,7 +291,7 @@ export class GraphFrame {
         return false;
     }
 
-    private _redrawFramePorts() {
+    public redrawFramePorts() {
         if(!this.isCollapsed) {
             return;
         }
@@ -643,7 +643,7 @@ export class GraphFrame {
             if (this.nodes.indexOf(node) === -1) {
                 return;
             }
-            this._redrawFramePorts();
+            this.redrawFramePorts();
         });
 
         this._commentsElement = document.createElement('div');

+ 8 - 0
nodeEditor/src/diagram/graphNode.ts

@@ -297,6 +297,14 @@ export class GraphNode {
             port.refresh();
         }
 
+        if(this.enclosingFrameId !== -1)
+        {   
+            let index = this._ownerCanvas.frames.findIndex(frame => frame.id === this.enclosingFrameId);
+            if(index >= 0 && this._ownerCanvas.frames[index].isCollapsed)
+            {
+                this._ownerCanvas.frames[index].redrawFramePorts();
+            }
+        }   
         this._comments.innerHTML = this.block.comments || "";
         this._comments.title = this.block.comments || "";