From 69afd97cb0ba2ddbe9121faf2e67e37194952da5 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 14 Apr 2020 18:39:24 +0300 Subject: [PATCH] Fixed bug where the user could drag the selection when it had no focus For example, when a window dialog was open. --- Scripts/SelectionRectangle.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/SelectionRectangle.gd b/Scripts/SelectionRectangle.gd index a9bdf5b..5dbbb97 100644 --- a/Scripts/SelectionRectangle.gd +++ b/Scripts/SelectionRectangle.gd @@ -33,7 +33,7 @@ func _process(delta : float) -> void: else: visible = true - if point_in_rectangle(mouse_pos, polygon[0], polygon[2]) && Global.selected_pixels.size() > 0 && (Global.current_left_tool == "RectSelect" || Global.current_right_tool == "RectSelect"): + if Global.can_draw and Global.has_focus and point_in_rectangle(mouse_pos, polygon[0], polygon[2]) and Global.selected_pixels.size() > 0 and (Global.current_left_tool == "RectSelect" or Global.current_right_tool == "RectSelect"): get_parent().get_parent().mouse_default_cursor_shape = Input.CURSOR_MOVE Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) if (Global.current_left_tool == "RectSelect" && Input.is_action_just_pressed("left_mouse")) || (Global.current_right_tool == "RectSelect" && Input.is_action_just_pressed("right_mouse")):