Fixed removal of all the colors from palette

This commit is contained in:
amritrai5757
2023-01-03 06:29:19 +00:00
parent d9bde9bee6
commit 901fdced90

View File

@ -109,10 +109,17 @@ const PaletteBlock = (() => {
endIndex = tmp; endIndex = tmp;
} }
if(coloursList.childElementCount > Math.abs(startIndex-endIndex)+1) {
for (let i=startIndex; i<=endIndex; i++) { for (let i=startIndex; i<=endIndex; i++) {
coloursList.removeChild(coloursList.children[startIndex]); coloursList.removeChild(coloursList.children[startIndex]);
} }
clearBorders(); clearBorders();
} else if(coloursList.childElementCount > 1){
for (let i=startIndex; i<endIndex; i++) {
coloursList.removeChild(coloursList.children[startIndex]);
}
clearBorders();
}
} }
/** Starts selecting a ramp. Saves the data needed to draw the outline. /** Starts selecting a ramp. Saves the data needed to draw the outline.