mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Fixed blurry cut in Firefox
This commit is contained in:
parent
f92a7f4a46
commit
b26ac05a84
@ -73,12 +73,13 @@ function endRectSelection(mouseEvent) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function cutSelection(mouseEvent) {
|
function cutSelection(mouseEvent) {
|
||||||
|
console.log("Coordinate: start x, y: " + startX + ", " + startY + " end x, y: " + endX + ", " + endY);
|
||||||
// Getting the selected pixels
|
// Getting the selected pixels
|
||||||
imageDataToMove = currentLayer.context.getImageData(startX, startY, endX - startX + 1, endY - startY + 1);
|
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
|
// 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]];
|
//originalDataPosition = [currentPos[0], currentPos[1]];
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user