From 46e4ea15adeddc981692d12275c6dc92e44e4937 Mon Sep 17 00:00:00 2001 From: OverloadedOrama <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 5 Jan 2020 22:40:07 +0200 Subject: [PATCH] Fixed issue with line_2d in Canvas.gd where it wasn't being freed when releasing shift --- Scripts/Canvas.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Scripts/Canvas.gd b/Scripts/Canvas.gd index 5ab4922..d622f6a 100644 --- a/Scripts/Canvas.gd +++ b/Scripts/Canvas.gd @@ -259,6 +259,8 @@ func _input(event : InputEvent) -> void: Global.update_right_custom_brush() if Global.can_draw && Global.has_focus && Input.is_action_just_pressed("shift") && (["Pencil", "Eraser", "LightenDarken"].has(Global.current_left_tool) || ["Pencil", "Eraser", "LightenDarken"].has(Global.current_right_tool)): + if is_instance_valid(line_2d): + line_2d.queue_free() line_2d = Line2D.new() line_2d.width = 0.5 line_2d.default_color = Color.darkgray