diff --git a/js/block.js b/js/block.js index 49a417ca83..2b2bd5580e 100644 --- a/js/block.js +++ b/js/block.js @@ -2913,13 +2913,17 @@ class Block { y: Math.round(that.container.y - that.original.y) }; }); - + /** * Handles the pressmove event on the block container. * @param {Event} event - The pressmove event. */ this.container.on("pressmove", (event) =>{ // FIXME: More voodoo + + let disX = Math.abs(event.stageX / that.activity.getStageScale() - that.original.x); + let disY = Math.abs(event.stageY / that.activity.getStageScale() - that.original.y); + event.nativeEvent.preventDefault(); // Don't allow silence block to be dragged out of a note. @@ -2946,7 +2950,9 @@ class Block { } if (window.hasMouse) { - moved = true; + //check for shaky movements + if(disX > 2 || disY > 2) { + moved = true;} } else { // Make it eaiser to select text on mobile. setTimeout(() => { @@ -2974,7 +2980,7 @@ class Block { if (that.activity.blocksContainer.y === 0 && finalPos < 45) { dy += 45 - finalPos; } - + // scroll when reached edges. if (event.stageX < 10 && that.activity.scrollBlockContainer) that.blocks.moveAllBlocksExcept(that, 10, 0);