Skip to content

Commit

Permalink
fixed arrow direction when dragging an edge from an input port
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Wicenec committed Jul 23, 2024
1 parent d921af9 commit fe8faf1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/Errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 7 additions & 1 deletion src/GraphRenderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string> = ko.pureComputed(() => {
Expand Down

0 comments on commit fe8faf1

Please sign in to comment.