mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added Selection menu
Also fixed a few minor bugs.
This commit is contained in:
@@ -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();
|
||||
}
|
Reference in New Issue
Block a user