mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-02-07 10:59: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:
parent
585f83e28a
commit
062ce664ca
|
@ -499,10 +499,11 @@ func generate_gradient(image : Image, colors : Array, steps := 2, direction : in
|
||||||
color = colors[-1].linear_interpolate(colors[0], t * i)
|
color = colors[-1].linear_interpolate(colors[0], t * i)
|
||||||
colors.insert(1, color)
|
colors.insert(1, color)
|
||||||
|
|
||||||
image.lock()
|
image.unlock()
|
||||||
if direction == GradientDirection.BOTTOM or direction == GradientDirection.RIGHT:
|
if direction == GradientDirection.BOTTOM or direction == GradientDirection.RIGHT:
|
||||||
colors.invert()
|
colors.invert()
|
||||||
var size := image.get_size()
|
var size := image.get_size()
|
||||||
|
image.lock()
|
||||||
var gradient_size
|
var gradient_size
|
||||||
|
|
||||||
if direction == GradientDirection.TOP or direction == GradientDirection.BOTTOM:
|
if direction == GradientDirection.TOP or direction == GradientDirection.BOTTOM:
|
||||||
|
|
Loading…
Reference in a new issue