Store touch coordinates as ol.Pixel instead of goog.math.Coordinate

This commit is contained in:
Frederic Junod
2014-03-17 12:26:38 +01:00
parent 395fdf9bbf
commit a2375d58b6
2 changed files with 3 additions and 4 deletions

View File

@@ -58,7 +58,7 @@ ol.pointer.MouseSource = function(dispatcher) {
/**
* @const
* @type {Array.<goog.math.Coordinate>}
* @type {Array.<ol.Pixel>}
*/
this.lastTouches = [];
};
@@ -118,7 +118,7 @@ ol.pointer.MouseSource.prototype.isEventSimulatedFromTouch_ =
var x = inEvent.clientX, y = inEvent.clientY;
for (var i = 0, l = lts.length, t; i < l && (t = lts[i]); i++) {
// simulated mouse events will be swallowed near a primary touchend
var dx = Math.abs(x - t.x), dy = Math.abs(y - t.y);
var dx = Math.abs(x - t[0]), dy = Math.abs(y - t[1]);
if (dx <= ol.pointer.MouseSource.DEDUP_DIST &&
dy <= ol.pointer.MouseSource.DEDUP_DIST) {
return true;