mirror of
https://codeberg.org/StreamGraph/StreamGraph.git
synced 2024-11-13 19:49:55 +01:00
fix setting dirty multiple times when initializing from deck
This commit is contained in:
parent
d29adb8166
commit
4f40e91726
1 changed files with 8 additions and 3 deletions
|
@ -32,10 +32,13 @@ signal group_enter_requested(group_id: String)
|
|||
|
||||
var dirty: bool = false:
|
||||
set(v):
|
||||
if change_dirty:
|
||||
dirty = v
|
||||
dirty_state_changed.emit()
|
||||
var is_group: bool = false
|
||||
|
||||
var change_dirty: bool = true
|
||||
|
||||
signal dirty_state_changed
|
||||
|
||||
## Sets up the [member search_popup_panel] with an instance of [member ADD_NODE_SCENE]
|
||||
|
@ -114,18 +117,20 @@ func _on_scroll_offset_changed(offset: Vector2) -> void:
|
|||
|
||||
## Setups all the data from the set [member deck] in this [DeckRendererGraphEdit]
|
||||
func initialize_from_deck() -> void:
|
||||
change_dirty = false
|
||||
for i in get_children():
|
||||
i.queue_free()
|
||||
|
||||
scroll_offset = deck.get_meta("offset", Vector2())
|
||||
|
||||
is_group = deck.is_group
|
||||
dirty = false
|
||||
for node_id in deck.nodes:
|
||||
var node_renderer: DeckNodeRendererGraphNode = NODE_SCENE.instantiate()
|
||||
node_renderer.node = deck.nodes[node_id]
|
||||
add_child(node_renderer)
|
||||
node_renderer.position_offset = node_renderer.node.position_as_vector2()
|
||||
change_dirty = true
|
||||
dirty = false
|
||||
|
||||
refresh_connections()
|
||||
|
||||
|
|
Loading…
Reference in a new issue