From 8c7594a1c8573b55b7a00507d7599b918e72914a Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Fri, 13 Sep 2024 01:05:53 +0300 Subject: [PATCH] Add a failsafe to the previous commit's solution --- src/UI/Dialogs/ImageEffects/GradientDialog.gd | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/UI/Dialogs/ImageEffects/GradientDialog.gd b/src/UI/Dialogs/ImageEffects/GradientDialog.gd index 49b022073..a49dcc29b 100644 --- a/src/UI/Dialogs/ImageEffects/GradientDialog.gd +++ b/src/UI/Dialogs/ImageEffects/GradientDialog.gd @@ -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