1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Optimize Lasso tool's draw_preview()

Do not have it run when we're not creating a selection
This commit is contained in:
Manolis Papadeas 2021-05-16 18:55:34 +03:00
parent b8d055fe01
commit 61e7633365

View file

@ -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: