Tried to refactor more, snapped the brush preview to the pixel grid

This commit is contained in:
unsettledgames
2020-07-21 23:36:12 +02:00
parent 81cc4c8900
commit d14deeb761
4 changed files with 5 additions and 13 deletions

View File

@ -6,9 +6,6 @@ let copiedStartY;
let copiedEndX;
let copiedEndY;
// BUG: when merging tmp layer to currentLayer there are offset problems
// FIX: maybe copy the entire tmp layer and paste it so that the merging happens at 0,0
function copySelection() {
copiedEndX = endX;
copiedEndY = endY;
@ -65,9 +62,4 @@ function cutSelectionTool() {
clipboardData = currentLayer.context.getImageData(startX, startY, endX - startX + 1, endY - startY + 1);
currentLayer.context.clearRect(startX - 0.5, startY - 0.5, endX - startX + 1, endY - startY + 1);
}
// Moving those pixels from the current layer to the tmp layer
//TMPLayer.context.putImageData(imageDataToMove, startX + 1, startY);
//originalDataPosition = [currentPos[0], currentPos[1]];
}