mac bug fixed

This commit is contained in:
Luis Fernando Molina committed 2020-03-27 17:42:20 +01:00
1 parent 50f66656b2
commit ae653d96b9
4 files changed
+16 -3

No files matched your search

+6 -1
View File
@@ -201,6 +201,11 @@ function newViewport () {
if ((event.ctrlKey === true || event.metaKey === true)) { return }
let morePower = 1
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
+2
View File
@@ -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))
}
}