bug mac users
This commit is contained in:
1 parent
50f224e32a
commit
778cebdb0a
2 files changed
+4
-20
No files matched your search
@@ -197,6 +197,8 @@ 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
|
||||
@@ -204,7 +206,7 @@ function newViewport () {
|
||||
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 / 5 }
|
||||
if (isMac) { amount = amount / MAC_AMOUNT_FACTOR }
|
||||
|
||||
if (thisObject.zoomTargetLevel > 10) {
|
||||
amount = amount * 2
|
||||
@@ -222,7 +224,7 @@ function newViewport () {
|
||||
if (thisObject.zoomTargetLevel + amount * morePower < MIN_ZOOM_LEVEL) {
|
||||
return false
|
||||
}
|
||||
thisObject.zoomTargetLevel = Math.round(thisObject.zoomTargetLevel + amount * morePower)
|
||||
thisObject.zoomTargetLevel = Math.round((thisObject.zoomTargetLevel + amount * morePower) * MAC_AMOUNT_FACTOR) / MAC_AMOUNT_FACTOR
|
||||
|
||||
ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) / ANIMATION_STEPS * 100) / 100
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@ function newLayersPanel () {
|
||||
thisObject.container.detectMouseOver = true
|
||||
|
||||
let isInitialized = false
|
||||
let isMouseOver = false
|
||||
let mouseOverCounter = 0
|
||||
|
||||
let layersMap = new Map()
|
||||
@@ -39,12 +38,10 @@ function newLayersPanel () {
|
||||
let posiblePanelHeight = (layerHeight + LAYER_SEPARATION) * posibleVisibleLayers + headerHeight + footerHeight
|
||||
|
||||
let onMouseWheelEventSuscriptionId
|
||||
let onMouseOverEventSuscriptionId
|
||||
return thisObject
|
||||
|
||||
function finalize () {
|
||||
thisObject.container.eventHandler.stopListening(onMouseWheelEventSuscriptionId)
|
||||
thisObject.container.eventHandler.stopListening(onMouseOverEventSuscriptionId)
|
||||
|
||||
thisObject.panelTabButton.finalize()
|
||||
thisObject.panelTabButton = undefined
|
||||
@@ -79,7 +76,6 @@ function newLayersPanel () {
|
||||
thisObject.panelTabButton.initialize()
|
||||
|
||||
onMouseWheelEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
|
||||
onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
|
||||
|
||||
readObjectState()
|
||||
|
||||
@@ -172,11 +168,6 @@ function newLayersPanel () {
|
||||
}
|
||||
}
|
||||
|
||||
function onMouseOver (event) {
|
||||
isMouseOver = true
|
||||
mouseOverCounter = 150
|
||||
}
|
||||
|
||||
function onMouseWheel (event) {
|
||||
delta = event.wheelDelta
|
||||
if (delta > 0) {
|
||||
@@ -304,19 +295,10 @@ function newLayersPanel () {
|
||||
readObjectState()
|
||||
}
|
||||
|
||||
function mouseOverPhysics () {
|
||||
mouseOverCounter--
|
||||
if (mouseOverCounter < 0) {
|
||||
mouseOverCounter = 0
|
||||
isMouseOver = false
|
||||
}
|
||||
}
|
||||
|
||||
function physics () {
|
||||
if (isInitialized === false) { return }
|
||||
if (thisObject.payload.node === undefined) { return }
|
||||
|
||||
mouseOverPhysics()
|
||||
thisObject.panelTabButton.physics()
|
||||
saveFrame(thisObject.payload, thisObject.container.frame)
|
||||
syncWithConfigPhysics()
|
||||
|
||||
Reference in new issue
Block a user