Fixed to touch gesture

This commit is contained in:
Sam El-Husseini
2018-03-06 11:03:04 -08:00
parent 6326830e85
commit 580ef211d7

View File

@@ -135,6 +135,7 @@ Blockly.TouchGesture.prototype.bindMouseEvents = function(e) {
/*opt_noCaptureIdentifier*/ true);
e.preventDefault();
e.stopPropagation();
};
/**
@@ -143,7 +144,7 @@ Blockly.TouchGesture.prototype.bindMouseEvents = function(e) {
* @package
*/
Blockly.TouchGesture.prototype.handleStart = function(e) {
if (!this.isDragging) {
if (this.isDragging()) {
// A drag has already started, so this can no longer be a pinch-zoom.
return;
}
@@ -238,8 +239,8 @@ Blockly.TouchGesture.prototype.handleTouchStart = function(e) {
var point1 = this.cachedPoints_[pointers[1]];
this.startDistance_ = goog.math.Coordinate.distance(point0, point1);
this.isMultiTouch_ = true;
e.preventDefault();
}
e.preventDefault();
};
/**
@@ -272,8 +273,8 @@ Blockly.TouchGesture.prototype.handleTouchMove = function(e) {
workspace.zoom(position.x, position.y, delta);
}
this.previousScale_ = scale;
e.preventDefault();
}
e.preventDefault();
};
/**