From b26ac05a84a67053aa597ca22011553c112d1cda Mon Sep 17 00:00:00 2001 From: unsettledgames <47360416+unsettledgames@users.noreply.github.com> Date: Thu, 9 Apr 2020 17:20:40 +0200 Subject: [PATCH] Fixed blurry cut in Firefox --- js/_rectSelect.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/_rectSelect.js b/js/_rectSelect.js index c5f07bc..74c02f0 100644 --- a/js/_rectSelect.js +++ b/js/_rectSelect.js @@ -73,12 +73,13 @@ function endRectSelection(mouseEvent) { } function cutSelection(mouseEvent) { + console.log("Coordinate: start x, y: " + startX + ", " + startY + " end x, y: " + endX + ", " + endY); // Getting the selected pixels imageDataToMove = currentLayer.context.getImageData(startX, startY, endX - startX + 1, endY - startY + 1); - currentLayer.context.clearRect(startX - 1, startY - 1, 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, startY); + TMPLayer.context.putImageData(imageDataToMove, startX + 1, startY); //originalDataPosition = [currentPos[0], currentPos[1]]; }