mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
don't add group input and output nodes at the same position
This commit is contained in:
parent
9938bb9519
commit
16c6cfb4f9
1 changed files with 15 additions and 1 deletions
|
@ -188,7 +188,9 @@ func group_nodes(nodes_to_group: Array) -> Deck:
|
|||
var group := DeckHolder.add_empty_group()
|
||||
|
||||
var midpoint := Vector2()
|
||||
var temp := []
|
||||
|
||||
var rightmost := -INF
|
||||
var leftmost := INF
|
||||
for node: DeckNode in nodes_to_group:
|
||||
#if node.node_type == "group_node":
|
||||
#var _group_id: String = node.group_id
|
||||
|
@ -197,6 +199,11 @@ func group_nodes(nodes_to_group: Array) -> Deck:
|
|||
#group.groups[_group_id] = _group
|
||||
#_group._belonging_to = group
|
||||
|
||||
if node.position.x > rightmost:
|
||||
rightmost = node.position.x
|
||||
if node.position.x < leftmost:
|
||||
leftmost = node.position.x
|
||||
|
||||
var outgoing_connections := node.outgoing_connections.duplicate(true)
|
||||
|
||||
for from_port: int in outgoing_connections:
|
||||
|
@ -234,6 +241,13 @@ func group_nodes(nodes_to_group: Array) -> Deck:
|
|||
group.group_input_node = input_node._id
|
||||
group.group_output_node = output_node._id
|
||||
|
||||
input_node.position.x = leftmost - 350
|
||||
output_node.position.x = rightmost + 350
|
||||
input_node.position.y = midpoint.y
|
||||
output_node.position.y = midpoint.y
|
||||
input_node.position_updated.emit(input_node.position)
|
||||
output_node.position_updated.emit(output_node.position)
|
||||
|
||||
input_node.group_node = _group_node
|
||||
output_node.group_node = _group_node
|
||||
|
||||
|
|
Loading…
Reference in a new issue