i absolutely forgot to implement non-transparent selections

This commit is contained in:
GGod 2023-08-29 02:17:53 +02:00
parent 1a63fa81fe
commit 2eab7fd75d
1 changed files with 5 additions and 1 deletions

View File

@ -331,7 +331,7 @@ elements.selectionMove = {
const y = selectionPosition.y + j;
if (!selectionMoved[i][j] && transparentSelection.get()) continue;
if (pixelMap[x][y]) deletePixel(x, y);
createPixelColor(selectionMoved[i][j].element, x, y, selectionMoved[i][j].color);
if (selectionMoved[i][j]) createPixelColor(selectionMoved[i][j].element, x, y, selectionMoved[i][j].color);
}
}
selectionMoved = [];
@ -350,6 +350,10 @@ elements.paste = {
const x = mousePos.x + i;
const y = mousePos.y + j;
if (outOfBounds(x, y) || (!clipboard[i][j] && transparentSelection.get())) continue;
if (!clipboard[i][j]) {
if (pixelMap[x][y]) deletePixel(x, y);
continue;
}
if (!pixelMap[x][y]) createPixelColor(clipboard[i][j].element, x, y, clipboard[i][j].color);
else {
deletePixel(x, y);