summaryrefslogtreecommitdiff
path: root/scene/gui/graph_edit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/gui/graph_edit.cpp')
-rw-r--r--scene/gui/graph_edit.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp
index a7c15e7027..f779aca672 100644
--- a/scene/gui/graph_edit.cpp
+++ b/scene/gui/graph_edit.cpp
@@ -775,6 +775,11 @@ 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();
for (int i = get_child_count() - 1; i >= 0; i--) {
@@ -881,16 +886,17 @@ 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;