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;
}
for (let i=startIndex; i<=endIndex; i++) {
coloursList.removeChild(coloursList.children[startIndex]);
if(coloursList.childElementCount > Math.abs(startIndex-endIndex)+1) {
for (let i=startIndex; i<=endIndex; i++) {
coloursList.removeChild(coloursList.children[startIndex]);
}
clearBorders();
} else if(coloursList.childElementCount > 1){
for (let i=startIndex; i<endIndex; i++) {
coloursList.removeChild(coloursList.children[startIndex]);
}
clearBorders();
}
clearBorders();
}
/** Starts selecting a ramp. Saves the data needed to draw the outline.