1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-07 17:36:07 +00:00

Fix emit_signal timing for GraphEdit's begin/end node move

(cherry picked from commit fbc095dc78)
This commit is contained in:
Gabriel Van Eyck
2020-10-19 18:25:07 -07:00
committed by Rémi Verschelde
parent ba00ced445
commit 7735cdaf8f
2 changed files with 8 additions and 3 deletions

View File

@@ -811,6 +811,10 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
}
if (mm.is_valid() && dragging) {
if (!moving_selection) {
emit_signal("_begin_node_move");
moving_selection = true;
}
just_selected = true;
drag_accum += mm->get_relative();
@@ -920,16 +924,16 @@ void GraphEdit::_gui_input(const Ref<InputEvent> &p_ev) {
}
if (drag_accum != Vector2()) {
emit_signal("_begin_node_move");
for (int i = get_child_count() - 1; i >= 0; i--) {
GraphNode *gn = Object::cast_to<GraphNode>(get_child(i));
if (gn && gn->is_selected())
gn->set_drag(false);
}
}
if (moving_selection) {
emit_signal("_end_node_move");
moving_selection = false;
}
dragging = false;