Added Selection menu

Also fixed a few minor bugs.
This commit is contained in:
unsettledgames
2020-06-06 21:44:52 +02:00
parent a252d396c6
commit 0fc1df1650
5 changed files with 42 additions and 15 deletions

View File

@@ -34,6 +34,7 @@ function endSelection() {
let cleanImageData = new ImageData(endX - startX, endY - startY);
if (imageDataToMove !== undefined) {
console.log("definito");
// Saving the current clipboard before editing it in order to merge it with the current layer
cleanImageData.data.set(imageDataToMove.data);
@@ -67,6 +68,7 @@ function endSelection() {
Math.round(lastMovePos[1] / zoom) - imageDataToMove.height / 2);
}
else {
console.log("incollo male");
currentLayer.context.putImageData(
imageDataToMove,
copiedStartX,
@@ -82,6 +84,7 @@ function endSelection() {
imageDataToMove = undefined;
isPasting = false;
isCutting = false;
lastMovePos = undefined;
new HistoryStateEditCanvas();
}