mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-19 23:14:47 +02:00
Make sure horizontal-only scroll events can be translated into map pans (close #7659)
This commit is contained in:
@@ -451,12 +451,6 @@ export function rendererMap(context) {
|
||||
var y = eventTransform.y;
|
||||
var k = eventTransform.k;
|
||||
|
||||
if (_transformStart.x === x &&
|
||||
_transformStart.y === y &&
|
||||
_transformStart.k === k) {
|
||||
return; // no change
|
||||
}
|
||||
|
||||
// Special handling of 'wheel' events:
|
||||
// They might be triggered by the user scrolling the mouse wheel,
|
||||
// or 2-finger pinch/zoom gestures, the transform may need adjustment.
|
||||
@@ -575,6 +569,12 @@ export function rendererMap(context) {
|
||||
|
||||
}
|
||||
|
||||
if (_transformStart.x === x &&
|
||||
_transformStart.y === y &&
|
||||
_transformStart.k === k) {
|
||||
return; // no change
|
||||
}
|
||||
|
||||
var withinEditableZoom = map.withinEditableZoom();
|
||||
if (_lastWithinEditableZoom !== withinEditableZoom) {
|
||||
if (_lastWithinEditableZoom !== undefined) {
|
||||
|
||||
@@ -212,13 +212,9 @@ export function utilZoomPan() {
|
||||
g.mouse[1] = t.invert(g.mouse[0] = p);
|
||||
}
|
||||
clearTimeout(g.wheel);
|
||||
}
|
||||
|
||||
// If this wheel event won’t trigger a transform change, ignore it.
|
||||
else if (t.k === k) return;
|
||||
|
||||
// Otherwise, capture the mouse point and location at the start.
|
||||
else {
|
||||
} else {
|
||||
g.mouse = [p, t.invert(p)];
|
||||
d3_interrupt(this);
|
||||
g.start();
|
||||
|
||||
Reference in New Issue
Block a user