Fix mouse wheel performance on MAC, when using non-infinite scroll mouse devices

This commit is contained in:
Oren Kedem committed 2021-06-16 11:25:56 +03:00
1 parent 74f35535e8
commit 1bc5ba612c
8 files changed
+8 -7

No files matched your search

@@ -175,7 +175,7 @@ function newRateScale() {
}
function onMouseWheel(event, autoScale) {
if (IS_MAC) {
if (IS_MAC && Math.abs(event.wheelDelta) < MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD) {
let sensitivity
if (event.delta < 0) {
if (event.shiftKey === true) {
@@ -251,7 +251,7 @@ function newTimeFrameScale() {
}
function onMouseWheel(event) {
if (IS_MAC) {
if (IS_MAC && Math.abs(event.wheelDelta) < MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD) {
let sensitivity
if (event.delta < 0) {
if (event.shiftKey === true) {
@@ -126,7 +126,7 @@ function newTimeScale() {
}
function onMouseWheel(event, autoScale) {
if (IS_MAC) {
if (IS_MAC && Math.abs(event.wheelDelta) < MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD) {
let sensitivity
if (event.delta < 0) {
if (event.shiftKey === true) {
@@ -206,7 +206,7 @@ function newViewport() {
if ((event.ctrlKey === true || event.metaKey === true)) { return }
let morePower = 1
if (IS_MAC) {
if (IS_MAC && Math.abs(event.wheelDelta) < MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD) {
let sensitivity
if (event.delta < 0) {
if (event.shiftKey === true) {
@@ -138,7 +138,7 @@ function newPicker() {
function onMouseWheel() {
if (IS_MAC) {
if (IS_MAC && Math.abs(event.wheelDelta) < MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD) {
let sensitivity
if (event.delta < 0) {
if (event.shiftKey === true) {
@@ -212,7 +212,7 @@ function newLayersPanel() {
function onMouseWheel(event) {
if (IS_MAC) {
if (IS_MAC && Math.abs(event.wheelDelta) < MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD) {
let sensitivity
if (event.delta < 0) {
if (event.shiftKey === true) {
@@ -124,7 +124,7 @@ function newListView() {
function onMouseWheel(event) {
if (IS_MAC) {
if (IS_MAC && Math.abs(event.wheelDelta) < MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD) {
let sensitivity
if (event.delta < 0) {
if (event.shiftKey === true) {
+1
View File
@@ -69,6 +69,7 @@ const MAC_AMOUNT_FACTOR = 5
const IS_MAC = navigator.platform.toUpperCase().indexOf('MAC') >= 0
const MAC_ZOOM_SENSITIVITY = 5
const MAC_SCROLL_SENSITIVITY = 20
const MAC_MOUSE_WHEEL_INFINITE_SCROLL_THRESHOLD= 120
const DEBUG = {}