mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Implement cut tool
yeah that was the easy part but still - Added hotkeys for copy, paste and cut - Added _copyPaste.js for copy, cut and paste management
This commit is contained in:
@ -72,10 +72,11 @@ function endRectSelection(mouseEvent) {
|
||||
currentTool.updateCursor();
|
||||
}
|
||||
|
||||
function cutSelection(mouseEvent) {
|
||||
function cutSelection(mousePosition) {
|
||||
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);
|
||||
clipBoardData = imageDataToMove;
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user