From 1e6460e4398a61e68b999bdb955600bc025d5ab5 Mon Sep 17 00:00:00 2001 From: Manolis Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Wed, 26 May 2021 15:48:26 +0300 Subject: [PATCH] Keep colors of a palette if the width gets bigger and the height gets smaller --- src/Palette/Palette.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Palette/Palette.gd b/src/Palette/Palette.gd index 59546adbe..b5794c5a0 100644 --- a/src/Palette/Palette.gd +++ b/src/Palette/Palette.gd @@ -43,8 +43,9 @@ func edit(new_name: String, new_width: int, new_height: int, new_comment: String # If size was reduced colors must be reindexed to fit into new smaller size reindex_colors_on_size_reduce(true) - if old_width < new_width: + if old_width < new_width and colors_max > old_colors_max: # If width increases colors have to be reindexed so they keep same grid positions + # unless the height has become smaller and we have to re-position the colors so that they won't get erased reindex_colors_on_width_increase(old_width)