diff --git a/src/Errors.ts b/src/Errors.ts index 3833ce66..375b1509 100644 --- a/src/Errors.ts +++ b/src/Errors.ts @@ -133,8 +133,4 @@ export namespace Errors Loading = "Loading", Graph = "Graph" } -} - - -//change data structure of each nodes, fields and edges and new logicalgraph is valid function to be {issue, validity}[] -// move to errors, use for nodes,fields and edges +} \ No newline at end of file diff --git a/src/GraphRenderer.ts b/src/GraphRenderer.ts index 787d4628..febb9e91 100644 --- a/src/GraphRenderer.ts +++ b/src/GraphRenderer.ts @@ -910,7 +910,13 @@ export class GraphRenderer { const srcField: Field = GraphRenderer.portDragSourcePort(); const destField: Field = null; - return GraphRenderer.createBezier(false,true, null, srcNodeRadius, destNodeRadius, {x:srcX, y:srcY}, {x:destX, y:destY}, srcField, destField, GraphRenderer.portDragSourcePortIsInput); + //if we are dragging from an input port well pass the dragSrcPort(the input port) as the destination of edge. this is so the flow arrow on the edge is point in the correct direction in terms of graph flow + if(GraphRenderer.portDragSourcePortIsInput){ + return GraphRenderer.createBezier(false,true, null, destNodeRadius, srcNodeRadius, {x:destX, y:destY}, {x:srcX, y:srcY}, destField, srcField, !GraphRenderer.portDragSourcePortIsInput); + }else{ + return GraphRenderer.createBezier(false,true, null, srcNodeRadius, destNodeRadius, {x:srcX, y:srcY}, {x:destX, y:destY}, srcField, destField, GraphRenderer.portDragSourcePortIsInput); + } + }, this); static getPathSuggestedEdge : ko.PureComputed = ko.pureComputed(() => {