diff --git a/ChartingSpace/Viewport.js b/ChartingSpace/Viewport.js index ff472c391..4fd3c840f 100644 --- a/ChartingSpace/Viewport.js +++ b/ChartingSpace/Viewport.js @@ -200,7 +200,12 @@ function newViewport () { if (thisObject.visible === false) { return } if ((event.ctrlKey === true || event.metaKey === true)) { return } let morePower = 1 - let amount = event.delta * MAC_AMOUNT_FACTOR + let amount = event.delta + + if (IS_MAC) { + event.delta = event.delta * MAC_AMOUNT_FACTOR + } + if (event.buttons === 4) { morePower = 2 } // Mouse wheel pressed. /* We adjust the sensitivity for Mac Users */ @@ -220,7 +225,7 @@ function newViewport () { if (thisObject.zoomTargetLevel + amount * morePower < MIN_ZOOM_LEVEL) { return false } - thisObject.zoomTargetLevel = Math.round(Math.round((thisObject.zoomTargetLevel + amount * morePower) * MAC_AMOUNT_FACTOR) / MAC_AMOUNT_FACTOR) + thisObject.zoomTargetLevel = Math.round(thisObject.zoomTargetLevel + amount * morePower) ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) / ANIMATION_STEPS * 100) / 100 diff --git a/SystemEventHandler.js b/SystemEventHandler.js index d8c4b520c..b200cc1b2 100644 --- a/SystemEventHandler.js +++ b/SystemEventHandler.js @@ -46,6 +46,8 @@ function newSystemEventHandler () { if (WEB_SOCKETS_CONNECTION.readyState === 1) { // 1 means connected and ready. WEB_SOCKETS_CONNECTION.send(JSON.stringify(command)) + } else { + console.log('WebSocket message could not be sent because the connection was not ready. Message = ' + JSON.stringify(command)) } }