mac users bug fixed
This commit is contained in:
1 parent
aa8d5d4c71
commit
27dfde0ad0
3 files changed
+7
-4
No files matched your search
@@ -834,6 +834,8 @@ function newCanvas () {
|
||||
|
||||
function onMouseWheel (event) {
|
||||
try {
|
||||
if (IS_MAC) { event.delta = event.delta / MAC_AMOUNT_FACTOR }
|
||||
|
||||
thisObject.mouse.event = event
|
||||
thisObject.mouse.position.x = event.pageX
|
||||
thisObject.mouse.position.y = event.pageY - CURRENT_TOP_MARGIN
|
||||
|
||||
@@ -197,16 +197,14 @@ function newViewport () {
|
||||
}
|
||||
|
||||
function onMouseWheel (event) {
|
||||
const MAC_AMOUNT_FACTOR = 5
|
||||
|
||||
if (thisObject.visible === false) { return }
|
||||
if ((event.ctrlKey === true || event.metaKey === true)) { return }
|
||||
let morePower = 1
|
||||
let amount = event.delta
|
||||
if (event.buttons === 4) { morePower = 2 } // Mouse wheel pressed.
|
||||
/* We adjust the sensitivity for Mac Users */
|
||||
let isMac = navigator.platform.toUpperCase().indexOf('MAC') >= 0
|
||||
if (isMac) { amount = amount / MAC_AMOUNT_FACTOR }
|
||||
|
||||
if (IS_MAC) { amount = amount / MAC_AMOUNT_FACTOR }
|
||||
|
||||
if (thisObject.zoomTargetLevel > 10) {
|
||||
amount = amount * 2
|
||||
|
||||
@@ -41,6 +41,9 @@ UI_FONT = {
|
||||
SECONDARY: "Source Code Pro"
|
||||
};
|
||||
|
||||
const MAC_AMOUNT_FACTOR = 5
|
||||
const IS_MAC = navigator.platform.toUpperCase().indexOf('MAC') >= 0
|
||||
|
||||
const DOUBLE_CLICK_ZOOM_OUT_LEVEL = 0
|
||||
const DOUBLE_CLICK_ZOOM_IN_LEVEL = 7
|
||||
|
||||
|
||||
Reference in new issue
Block a user