From 1e8ca95cdc01a3ef11a58e0434d76455cae85b96 Mon Sep 17 00:00:00 2001 From: Hendrik Brucker Date: Sun, 25 Jun 2023 17:13:53 +0200 Subject: [PATCH] [GraphEdit] Fix port hotzones at zoom levels other than 100% --- scene/gui/graph_edit.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scene/gui/graph_edit.cpp b/scene/gui/graph_edit.cpp index e6f936059b1..2c37017fa13 100644 --- a/scene/gui/graph_edit.cpp +++ b/scene/gui/graph_edit.cpp @@ -822,6 +822,7 @@ bool GraphEdit::_check_clickable_control(Control *p_control, const Vector2 &mpos Rect2 control_rect = p_control->get_rect(); control_rect.position *= zoom; + control_rect.size *= zoom; control_rect.position += p_offset; if (!control_rect.has_point(mpos) || p_control->get_mouse_filter() == MOUSE_FILTER_IGNORE) { @@ -886,9 +887,8 @@ bool GraphEdit::is_in_port_hotzone(const Vector2 &p_pos, const Vector2 &p_mouse_ if (!child) { continue; } - Rect2 child_rect = child->get_rect(); - child_rect.size *= zoom; + Rect2 child_rect = child->get_rect(); if (child_rect.has_point(p_mouse_pos * zoom)) { for (int j = 0; j < child->get_child_count(); j++) { Control *subchild = Object::cast_to(child->get_child(j));