From 1bdc14acea6b2ce932e6cf01dc9d7942f72503e9 Mon Sep 17 00:00:00 2001 From: volzhs Date: Thu, 25 Mar 2021 13:21:34 +0900 Subject: Fix drawing boxselection on GraphEdit --- scene/gui/graph_edit.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 71d31434d4..5baad18f7a 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1312,6 +1312,7 @@ void GraphEdit::_gui_input(const Ref &p_ev) { if (b->get_button_index() == BUTTON_LEFT && !b->is_pressed() && box_selecting) { box_selecting = false; + box_selecting_rect = Rect2(); previus_selected.clear(); top_layer->update(); minimap->update(); -- cgit v1.2.3 From 990c88f24c33e8be9507d6b3c626289cf0cfae26 Mon Sep 17 00:00:00 2001 From: volzhs Date: Thu, 25 Mar 2021 20:08:38 +0900 Subject: Fix typo 'previus_selected' --- scene/gui/graph_edit.cpp | 16 ++++++++-------- scene/gui/graph_edit.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 5baad18f7a..dbd2f140f5 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -1123,7 +1123,7 @@ void GraphEdit::_gui_input(const Ref &p_ev) { } gn->set_selected(box_selection_mode_additive); } else { - bool select = (previus_selected.find(gn) != nullptr); + bool select = (previous_selected.find(gn) != nullptr); if (gn->is_selected() && !select) { emit_signal("node_deselected", gn); } else if (!gn->is_selected() && select) { @@ -1148,7 +1148,7 @@ void GraphEdit::_gui_input(const Ref &p_ev) { continue; } - bool select = (previus_selected.find(gn) != nullptr); + bool select = (previous_selected.find(gn) != nullptr); if (gn->is_selected() && !select) { emit_signal("node_deselected", gn); } else if (!gn->is_selected() && select) { @@ -1273,29 +1273,29 @@ void GraphEdit::_gui_input(const Ref &p_ev) { box_selecting_from = b->get_position(); if (b->get_control()) { box_selection_mode_additive = true; - previus_selected.clear(); + previous_selected.clear(); for (int i = get_child_count() - 1; i >= 0; i--) { GraphNode *gn2 = Object::cast_to(get_child(i)); if (!gn2 || !gn2->is_selected()) { continue; } - previus_selected.push_back(gn2); + previous_selected.push_back(gn2); } } else if (b->get_shift()) { box_selection_mode_additive = false; - previus_selected.clear(); + previous_selected.clear(); for (int i = get_child_count() - 1; i >= 0; i--) { GraphNode *gn2 = Object::cast_to(get_child(i)); if (!gn2 || !gn2->is_selected()) { continue; } - previus_selected.push_back(gn2); + previous_selected.push_back(gn2); } } else { box_selection_mode_additive = true; - previus_selected.clear(); + previous_selected.clear(); for (int i = get_child_count() - 1; i >= 0; i--) { GraphNode *gn2 = Object::cast_to(get_child(i)); if (!gn2) { @@ -1313,7 +1313,7 @@ void GraphEdit::_gui_input(const Ref &p_ev) { if (b->get_button_index() == BUTTON_LEFT && !b->is_pressed() && box_selecting) { box_selecting = false; box_selecting_rect = Rect2(); - previus_selected.clear(); + previous_selected.clear(); top_layer->update(); minimap->update(); } diff --git a/scene/gui/graph_edit.h b/scene/gui/graph_edit.h index 8fdf975319..fa3b113705 100644 --- a/scene/gui/graph_edit.h +++ b/scene/gui/graph_edit.h @@ -150,7 +150,7 @@ private: Point2 box_selecting_from; Point2 box_selecting_to; Rect2 box_selecting_rect; - List previus_selected; + List previous_selected; bool setting_scroll_ofs = false; bool right_disconnects = false; -- cgit v1.2.3