diff options
author | Hendrik Brucker <hendrik.brucker@mail.de> | 2024-08-02 12:38:53 +0200 |
---|---|---|
committer | Hendrik Brucker <hendrik.brucker@mail.de> | 2024-08-02 12:38:53 +0200 |
commit | 1f0eddca7031524d6c19ed41c9ef609fe49afabf (patch) | |
tree | b7abf0cc2513d3f667df43e6db208d2cbf58c6e8 | |
parent | 3978628c6cc1227250fc6ed45c8d854d24c30c30 (diff) | |
download | redot-engine-1f0eddca7031524d6c19ed41c9ef609fe49afabf.tar.gz |
Fix GraphEdit port snapping in certain edge cases
-rw-r--r-- | scene/gui/graph_edit.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index 9b762f7b3c..60b3e371a0 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -912,7 +912,7 @@ bool GraphEdit::_filter_input(const Point2 &p_point) { // This prevents interactions with a port hotzone that is behind another node. Rect2 graph_node_rect = Rect2(graph_node->get_position(), graph_node->get_size() * zoom); - if (graph_node_rect.has_point(click_pos * zoom)) { + if (graph_node_rect.has_point(p_point)) { break; } } @@ -1044,12 +1044,6 @@ void GraphEdit::_top_connection_layer_input(const Ref<InputEvent> &p_ev) { return; } } - - // This prevents interactions with a port hotzone that is behind another node. - Rect2 graph_node_rect = Rect2(graph_node->get_position(), graph_node->get_size() * zoom); - if (graph_node_rect.has_point(click_pos * zoom)) { - break; - } } } @@ -1121,6 +1115,12 @@ void GraphEdit::_top_connection_layer_input(const Ref<InputEvent> &p_ev) { } connecting_target_valid = false; } + + // This prevents interactions with a port hotzone that is behind another node. + Rect2 graph_node_rect = Rect2(graph_node->get_position(), graph_node->get_size() * zoom); + if (graph_node_rect.has_point(mm->get_position())) { + break; + } } } } |