Skip to content

Commit

Permalink
Add node to end of workflow if no target specified
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Jun 13, 2023
1 parent 82daed2 commit 075f531
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Bonsai.Editor/GraphModel/WorkflowEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,8 @@ private int GetInsertIndex(
Node<ExpressionBuilder, ExpressionBuilderArgument> target,
CreateGraphNodeType nodeType)
{
var insertOffset = target == null || nodeType == CreateGraphNodeType.Successor ? 1 : 0;
if (target == null) return workflow.Count;
var insertOffset = nodeType == CreateGraphNodeType.Successor ? 1 : 0;
return workflow.IndexOf(target) + insertOffset;
}

Expand Down

0 comments on commit 075f531

Please sign in to comment.