Stop handling events immediately when click tolerance is exceeded
This commit is contained in:
@@ -423,6 +423,9 @@ Draw.prototype.handlePointerMove_ = function(event) {
|
||||
this.shouldHandle_ = this.freehand_ ?
|
||||
squaredDistance > this.squaredClickTolerance_ :
|
||||
squaredDistance <= this.squaredClickTolerance_;
|
||||
if (!this.shouldHandle_) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (this.finishCoordinate_) {
|
||||
|
||||
@@ -339,7 +339,6 @@ describe('ol.interaction.Draw', function() {
|
||||
simulateEvent('pointermove', 20, 30);
|
||||
|
||||
// freehand
|
||||
simulateEvent('pointerdown', 20, 30, true);
|
||||
simulateEvent('pointermove', 20, 30, true);
|
||||
simulateEvent('pointerdrag', 20, 30, true);
|
||||
simulateEvent('pointermove', 30, 40, true);
|
||||
|
||||
Reference in New Issue
Block a user