avoid filling history with uneventful moves
Signed-off-by: Victor Seiji Hariki <victorseijih@gmail.com>
This commit is contained in:
parent
7394ffff57
commit
b9976d9e8b
1 changed files with 11 additions and 1 deletions
|
@ -183,7 +183,7 @@ const selectTransformTool = () =>
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
// Mouse move handelr. As always, also renders cursor
|
// Mouse move handler. As always, also renders cursor
|
||||||
state.movecb = (evn) => {
|
state.movecb = (evn) => {
|
||||||
ovCtx.clearRect(0, 0, ovCanvas.width, ovCanvas.height);
|
ovCtx.clearRect(0, 0, ovCanvas.width, ovCanvas.height);
|
||||||
imageCollection.inputElement.style.cursor = "auto";
|
imageCollection.inputElement.style.cursor = "auto";
|
||||||
|
@ -298,6 +298,16 @@ const selectTransformTool = () =>
|
||||||
|
|
||||||
// Handles left mouse clicks
|
// Handles left mouse clicks
|
||||||
state.clickcb = (evn) => {
|
state.clickcb = (evn) => {
|
||||||
|
if (
|
||||||
|
state.original.x === state.selected.x &&
|
||||||
|
state.original.y === state.selected.y &&
|
||||||
|
state.original.w === state.selected.w &&
|
||||||
|
state.original.h === state.selected.h
|
||||||
|
) {
|
||||||
|
state.reset();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// If something is selected, commit changes to the canvas
|
// If something is selected, commit changes to the canvas
|
||||||
if (state.selected) {
|
if (state.selected) {
|
||||||
imgCtx.drawImage(
|
imgCtx.drawImage(
|
||||||
|
|
Loading…
Reference in a new issue