Merge pull request #128 from GGodPL/main

This commit is contained in:
slweeb 2023-08-28 20:18:40 -04:00 committed by GitHub
commit 42d85e2aad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);