From 950f075269dc03c93e07eacf33705f8b445c8a25 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Tue, 25 May 2021 14:24:30 +0300 Subject: [PATCH] Fix resizing palette issue Having one dimension less than 8 and one higher than 8 caused issues. This should now be fixed. --- src/Palette/PaletteGrid.gd | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Palette/PaletteGrid.gd b/src/Palette/PaletteGrid.gd index b71fdddef..cd3a9cc05 100644 --- a/src/Palette/PaletteGrid.gd +++ b/src/Palette/PaletteGrid.gd @@ -54,7 +54,7 @@ func display_palette(palette: Palette) -> void: init_swatches() 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() init_swatches() elif palette.width >= MAX_GRID_SIZE.x and palette.height >= MAX_GRID_SIZE.y and grid_size != MAX_GRID_SIZE: