Assumption about mozInputSource = 1 was incorrect

Removing this conditional allows 2 finger panning on Firefox
This commit is contained in:
Bryan Housel
2019-01-15 14:45:52 -05:00
parent 0b295db7df
commit 68be75af09
+4 -8
View File
@@ -498,14 +498,10 @@ export function rendererMap(context) {
// - `ctrlKey = false`
// - `deltaX`,`deltaY` are round integer pixels
} else if (detected.os === 'mac' && !source.ctrlKey && isInteger(dX) && isInteger(dY)) {
// Firefox will set `mozInputSource = 1` if the event was generated
// by an actual mouse wheel. If we detect this, don't pan..
if (source.mozInputSource === undefined || source.mozInputSource !== 1) {
p1 = projection.translate();
x2 = p1[0] - dX;
y2 = p1[1] - dY;
k2 = projection.scale();
}
p1 = projection.translate();
x2 = p1[0] - dX;
y2 = p1[1] - dY;
k2 = projection.scale();
}
// something changed - replace the event transform