1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Unlock the image before getting its size in generate_gradient()

This *may* solve a rare crash related to memory.
This commit is contained in:
OverloadedOrama 2020-07-25 20:17:47 +03:00
parent 585f83e28a
commit 062ce664ca

View file

@ -499,10 +499,11 @@ func generate_gradient(image : Image, colors : Array, steps := 2, direction : in
color = colors[-1].linear_interpolate(colors[0], t * i)
colors.insert(1, color)
image.lock()
image.unlock()
if direction == GradientDirection.BOTTOM or direction == GradientDirection.RIGHT:
colors.invert()
var size := image.get_size()
image.lock()
var gradient_size
if direction == GradientDirection.TOP or direction == GradientDirection.BOTTOM: