1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-18 17:19:50 +00:00

Fix crash when Pixelorama starts without a palette

This commit is contained in:
Emmanouil Papadeas 2024-11-23 14:17:27 +02:00
parent 658477ed4b
commit 5f53a3eb7b

View file

@ -87,6 +87,8 @@ func scroll_palette(origin: Vector2i) -> void:
## Called when the color changes, either the left or the right, determined by [param mouse_button]. ## Called when the color changes, either the left or the right, determined by [param mouse_button].
## If current palette has [param target_color] as a [Color], then select it. ## If current palette has [param target_color] as a [Color], then select it.
func find_and_select_color(target_color: Color, mouse_button: int) -> void: func find_and_select_color(target_color: Color, mouse_button: int) -> void:
if not is_instance_valid(current_palette):
return
var old_index := Palettes.current_palette_get_selected_color_index(mouse_button) var old_index := Palettes.current_palette_get_selected_color_index(mouse_button)
for color_ind in swatches.size(): for color_ind in swatches.size():
if ( if (