Move tolerance should not increase with higher pixel ratio
Browsers already handle the scaling, no need to multiply this again. This now also allows setting a moveTolerance of zero which was not possible before. In the isMoving_ method the condition is distance > tolerance so this will work.
This commit is contained in:
@@ -7,7 +7,7 @@ import MapBrowserEvent from './MapBrowserEvent.js';
|
|||||||
import MapBrowserEventType from './MapBrowserEventType.js';
|
import MapBrowserEventType from './MapBrowserEventType.js';
|
||||||
import PointerEventType from './pointer/EventType.js';
|
import PointerEventType from './pointer/EventType.js';
|
||||||
import Target from './events/Target.js';
|
import Target from './events/Target.js';
|
||||||
import {DEVICE_PIXEL_RATIO, PASSIVE_EVENT_LISTENERS} from './has.js';
|
import {PASSIVE_EVENT_LISTENERS} from './has.js';
|
||||||
import {VOID} from './functions.js';
|
import {VOID} from './functions.js';
|
||||||
import {listen, unlistenByKey} from './events.js';
|
import {listen, unlistenByKey} from './events.js';
|
||||||
|
|
||||||
@@ -54,9 +54,7 @@ class MapBrowserEventHandler extends Target {
|
|||||||
* @type {number}
|
* @type {number}
|
||||||
* @private
|
* @private
|
||||||
*/
|
*/
|
||||||
this.moveTolerance_ = moveTolerance
|
this.moveTolerance_ = moveTolerance === undefined ? 1 : moveTolerance;
|
||||||
? moveTolerance * DEVICE_PIXEL_RATIO
|
|
||||||
: DEVICE_PIXEL_RATIO;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The most recent "down" type event (or null if none have occurred).
|
* The most recent "down" type event (or null if none have occurred).
|
||||||
|
|||||||
Reference in New Issue
Block a user