mirror of
https://github.com/lospec/pixel-editor.git
synced 2023-08-10 21:12:51 +03:00
Added fill mode for the rectangle tool
You can select the fill mode by clicking again on the rect button once you select it. Also added new icons.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
var imageDataToMove;
|
||||
var canMoveSelection = false;
|
||||
var lastMovePos;
|
||||
|
||||
// TODO: move with arrows
|
||||
function updateMovePreview(mouseEvent) {
|
||||
@@ -12,6 +13,7 @@ function updateMovePreview(mouseEvent) {
|
||||
Math.round(lastMousePos[0] / zoom - imageDataToMove.width / 2),
|
||||
Math.round(lastMousePos[1] / zoom - imageDataToMove.height / 2));
|
||||
|
||||
lastMovePos = lastMousePos;
|
||||
moveSelection(lastMousePos[0] / zoom, lastMousePos[1] / zoom, imageDataToMove.width, imageDataToMove.height)
|
||||
}
|
||||
|
||||
@@ -21,6 +23,6 @@ function endSelection() {
|
||||
|
||||
currentLayer.context.putImageData(
|
||||
imageDataToMove,
|
||||
Math.round(lastMousePos[0] / zoom - imageDataToMove.width / 2),
|
||||
Math.round(lastMousePos[1] / zoom - imageDataToMove.height / 2));
|
||||
Math.round(lastMovePos[0] / zoom - imageDataToMove.width / 2),
|
||||
Math.round(lastMovePos[1] / zoom - imageDataToMove.height / 2));
|
||||
}
|
Reference in New Issue
Block a user