1
0
Fork 0
mirror of https://github.com/Orama-Interactive/Pixelorama.git synced 2025-01-31 07:29:49 +00:00

Fix resizing palette issue

Having one dimension less than 8 and one higher than 8 caused issues. This should now be fixed.
This commit is contained in:
Manolis Papadeas 2021-05-25 14:24:30 +03:00
parent 4e8acdf002
commit 950f075269

View file

@ -54,7 +54,7 @@ func display_palette(palette: Palette) -> void:
init_swatches() init_swatches()
if palette.width < MAX_GRID_SIZE.x or palette.height < MAX_GRID_SIZE.y: if palette.width < MAX_GRID_SIZE.x or palette.height < MAX_GRID_SIZE.y:
grid_size = Vector2(palette.width, palette.height) grid_size = Vector2(min(palette.width, MAX_GRID_SIZE.x), min(palette.height, MAX_GRID_SIZE.y))
clear_swatches() clear_swatches()
init_swatches() init_swatches()
elif palette.width >= MAX_GRID_SIZE.x and palette.height >= MAX_GRID_SIZE.y and grid_size != MAX_GRID_SIZE: elif palette.width >= MAX_GRID_SIZE.x and palette.height >= MAX_GRID_SIZE.y and grid_size != MAX_GRID_SIZE: