mirror of
https://github.com/Leaflet/Leaflet.git
synced 2025-07-25 01:32:21 +00:00
Update wheelPxFactor on Linux+Chrome
Fixes #8859 Signed-off-by: Iván Sánchez Ortega <ivan@sanchezortega.es>
This commit is contained in:
@ -264,11 +264,10 @@ export function getMousePosition(e, container) {
|
|||||||
// @function getWheelPxFactor(): Number
|
// @function getWheelPxFactor(): Number
|
||||||
// Gets the wheel pixel factor based on the devicePixelRatio
|
// Gets the wheel pixel factor based on the devicePixelRatio
|
||||||
export function getWheelPxFactor() {
|
export function getWheelPxFactor() {
|
||||||
// We need double the scroll pixels (see #7403 and #4538) for all Browsers
|
// We need double the scroll pixels (see #8859, #7403 and #4538) for all Browsers
|
||||||
// except OSX (Mac) -> 3x, Chrome running on Linux 1x
|
// except OSX (Mac) -> 3x
|
||||||
const ratio = window.devicePixelRatio;
|
const ratio = window.devicePixelRatio;
|
||||||
return Browser.linux && Browser.chrome ? ratio :
|
return Browser.mac ? ratio * 3 :
|
||||||
Browser.mac ? ratio * 3 :
|
|
||||||
ratio > 0 ? 2 * ratio : 1;
|
ratio > 0 ? 2 * ratio : 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user