From 61e763336515135d61e3ab24e730fa1d13a97f8a Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Sun, 16 May 2021 18:55:34 +0300 Subject: [PATCH] Optimize Lasso tool's draw_preview() Do not have it run when we're not creating a selection --- src/Tools/SelectionTools/Lasso.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Tools/SelectionTools/Lasso.gd b/src/Tools/SelectionTools/Lasso.gd index 4bf5f8bbf..81ab22cc9 100644 --- a/src/Tools/SelectionTools/Lasso.gd +++ b/src/Tools/SelectionTools/Lasso.gd @@ -32,7 +32,7 @@ func draw_end(position : Vector2) -> void: func draw_preview() -> void: - if !_move: + if _last_position != Vector2.INF and !_move: var canvas : Node2D = Global.canvas.previews var _position := canvas.position var _scale := canvas.scale @@ -88,6 +88,7 @@ func apply_selection(_position) -> void: Global.canvas.selection.commit_undo("Rectangle Select", undo_data) _draw_points.clear() + _last_position = Vector2.INF func lasso_selection(bitmap : BitMap, points : PoolVector2Array) -> void: