Fixed bug where the user could drag the guides when the canvas had no focus

This commit is contained in:
OverloadedOrama 2020-04-15 19:54:59 +03:00
parent 10280f25f9
commit 4e33775c84
4 changed files with 6 additions and 7 deletions

View file

@ -71,7 +71,7 @@ func _ready() -> void:
"Invert colors" : 0,
"Desaturation" : 0,
"Outline" : 0,
"Adjust Hue/Saturation/Value":0
"Adjust Hue/Saturation/Value" : 0
}
var help_menu_items := {
"View Splash Screen" : 0,

View file

@ -25,7 +25,7 @@ func _process(delta : float) -> void:
else:
point0.x -= width * 3
point1.x += width * 3
if point_in_rectangle(mouse_pos, point0, point1) && Input.is_action_just_pressed("left_mouse"):
if Global.can_draw and Global.has_focus and point_in_rectangle(mouse_pos, point0, point1) and Input.is_action_just_pressed("left_mouse"):
if !point_in_rectangle(Global.canvas.current_pixel, Global.canvas.location, Global.canvas.location + Global.canvas.size):
has_focus = true
Global.has_focus = false