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

Fix crash when using indexed mode and the palette has empty swatches between colors

This commit is contained in:
Emmanouil Papadeas 2024-11-22 20:47:38 +02:00
parent 1dcb696c35
commit e6c4a72158

View file

@ -74,8 +74,9 @@ func select_palette(_name: String, convert_to_rgb := true) -> void:
## Updates [member palette] to contain the colors of [member current_palette].
func update_palette() -> void:
if palette.size() != current_palette.colors.size():
palette.resize(current_palette.colors.size())
if palette.size() != current_palette.colors_max:
palette.resize(current_palette.colors_max)
palette.fill(TRANSPARENT)
for i in current_palette.colors:
palette[i] = current_palette.colors[i].color