diff --git a/core/workspace_svg.js b/core/workspace_svg.js index f4ed5eb46..d62f720f7 100644 --- a/core/workspace_svg.js +++ b/core/workspace_svg.js @@ -1304,19 +1304,18 @@ Blockly.WorkspaceSvg.prototype.isMovable = function() { * @private */ Blockly.WorkspaceSvg.prototype.onMouseWheel_ = function(e) { + // Don't scroll or zoom anything if drag is in progress. + if (this.currentGesture_) { + e.preventDefault(); + e.stopPropagation(); + return; + } var canWheelZoom = this.options.zoomOptions && this.options.zoomOptions.wheel; var canWheelMove = this.options.moveOptions && this.options.moveOptions.wheel; if (!canWheelZoom && !canWheelMove) { return; } - // TODO: Remove gesture cancellation and compensate for coordinate skew during - // zoom. - if (this.currentGesture_) { - this.currentGesture_.cancel(); - } - - var scrollDelta = Blockly.utils.getScrollDeltaPixels(e); if (canWheelZoom && (e.ctrlKey || !canWheelMove)) { // The vertical scroll distance that corresponds to a click of a zoom button.