mirror of
https://github.com/Orama-Interactive/Pixelorama.git
synced 2025-01-18 09:09:47 +00:00
Add a failsafe to the previous commit's solution
This commit is contained in:
parent
1e2e5dc431
commit
8c7594a1c8
|
@ -76,6 +76,8 @@ func commit_action(cel: Image, project := Global.current_project) -> void:
|
|||
var c := offsets[i]
|
||||
offsets_image.set_pixel(i, 0, Color(c, c, c, c))
|
||||
var actual_index := gradient.offsets.find(offsets[i])
|
||||
if actual_index == -1:
|
||||
actual_index = i
|
||||
gradient_image.set_pixel(i, 0, gradient.colors[actual_index])
|
||||
var offsets_tex := ImageTexture.create_from_image(offsets_image)
|
||||
var gradient_tex: Texture2D
|
||||
|
|
Loading…
Reference in a new issue