mirror of
https://github.com/tonytins/CozyPixelStudio.git
synced 2025-05-05 12:44:49 -04:00
Speedup Draw.update_mask() (#439)
This commit is contained in:
parent
63838964b3
commit
85b0611ca0
1 changed files with 4 additions and 4 deletions
|
@ -131,10 +131,10 @@ func update_mirror_brush() -> void:
|
|||
|
||||
func update_mask() -> void:
|
||||
var size := _get_draw_image().get_size()
|
||||
_mask = PoolByteArray()
|
||||
_mask.resize(size.x * size.y)
|
||||
for i in _mask.size():
|
||||
_mask[i] = 0
|
||||
# Faster then zeroing PoolByteArray directly. See: https://github.com/Orama-Interactive/Pixelorama/pull/439
|
||||
var nulled_array := []
|
||||
nulled_array.resize(size.x * size.y)
|
||||
_mask = PoolByteArray(nulled_array)
|
||||
|
||||
|
||||
func update_line_polylines(start : Vector2, end : Vector2) -> void:
|
||||
|
|
Loading…
Add table
Reference in a new issue