Browse Source

Fix bug where Frame Port label was being generated from the incorrect node

When generating output frame ports labels for input nodes,
we should use the name of the input node, not the connected node which is
outside the frame.
Kyle Belfort 5 years ago
parent
commit
161d5198c0
2 changed files with 3 additions and 2 deletions
  1. 1 0
      dist/preview release/what's new.md
  2. 2 2
      nodeEditor/src/diagram/graphFrame.ts

+ 1 - 0
dist/preview release/what's new.md

@@ -39,6 +39,7 @@
 - Can now edit Node port names ([belfortk](https://github.com/belfortk))
 - Updated which node ports are shown on frames by default so that only node ports connected to outside nodes are by default exposed on the frame ([belfortk](https://github.com/belfortk))
 - Added a modulo block ([ageneau](https://github.com/ageneau))
+- Fix bug where frame port labels would be the names of incorrect nodes ([belfortk](https://github.com/belfortk))
 
 ### Inspector
 

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

@@ -134,12 +134,12 @@ export class GraphFrame {
                     let portAdded = false;
 
                     for (var link of node.links) {
-                        if (link.portA === port && this.nodes.indexOf(link.nodeB!) === -1 || (link.portA === port && port.exposedOnFrame)) {
+                        if (link.portA === port && this.nodes.indexOf(link.nodeB!) === -1 || (link.portA! === port && port.exposedOnFrame)) {
                             let localPort: FrameNodePort;
 
                             if (!portAdded) {
                                 portAdded = true;
-                                localPort = FrameNodePort.CreateFrameNodePortElement(port.connectionPoint, link.nodeB!, this._outputPortContainer, null, this._ownerCanvas.globalState, false, GraphFrame._FramePortCounter++, this.id);
+                                localPort = FrameNodePort.CreateFrameNodePortElement(port.connectionPoint, link.nodeA!, this._outputPortContainer, null, this._ownerCanvas.globalState, false, GraphFrame._FramePortCounter++, this.id);
                                 this._frameOutPorts.push(localPort);
 
                                 link.isVisible = true;