IS MAC
This commit is contained in:
1 parent
5c07408115
commit
d299cbd482
4 files changed
+48
-3
No files matched your search
+3
-1
@@ -842,7 +842,9 @@ function newCanvas () {
|
||||
// cross-browser wheel delta
|
||||
var event = window.event || event // old IE support
|
||||
event.delta = Math.max(-1, Math.min(1, event.wheelDelta || -event.detail))
|
||||
if (IS_MAC) { event.delta = event.delta / MAC_AMOUNT_FACTOR }
|
||||
if (IS_MAC) {
|
||||
event.delta = event.delta / MAC_AMOUNT_FACTOR
|
||||
}
|
||||
|
||||
/* We try first with panels. */
|
||||
|
||||
|
||||
@@ -366,6 +366,14 @@ function newFloatingObject () {
|
||||
}
|
||||
}
|
||||
|
||||
if (Math.abs(thisObject.currentHierarchyRing - thisObject.targetHierarchyRing) >= 1) {
|
||||
if (thisObject.currentHierarchyRing < thisObject.targetHierarchyRing) {
|
||||
thisObject.currentHierarchyRing = thisObject.currentHierarchyRing + 1
|
||||
} else {
|
||||
thisObject.currentHierarchyRing = thisObject.currentHierarchyRing - 1
|
||||
}
|
||||
}
|
||||
|
||||
/* Floating object position in screen coordinates */
|
||||
|
||||
thisObject.payload.position.x = thisObject.container.frame.position.x
|
||||
@@ -473,7 +481,7 @@ function newFloatingObject () {
|
||||
}
|
||||
|
||||
function initializeImageSize (suggestedValue) {
|
||||
var size = suggestedValue
|
||||
let size = suggestedValue
|
||||
if (size < 2) {
|
||||
size = 2
|
||||
}
|
||||
|
||||
@@ -1239,7 +1239,7 @@ function newUiObject () {
|
||||
let nodeDefinition = APP_SCHEMA_MAP.get(thisObject.payload.node.type)
|
||||
if (nodeDefinition !== undefined) {
|
||||
if (nodeDefinition.isHierarchyHead === true) {
|
||||
VISIBLE_RADIUS = thisObject.container.frame.radius * 1.1
|
||||
VISIBLE_RADIUS = thisObject.container.frame.radius * 1.4
|
||||
let OPACITY = 1
|
||||
|
||||
browserCanvasContext.beginPath()
|
||||
|
||||
@@ -45,6 +45,10 @@ function newTimeFrameScale () {
|
||||
}
|
||||
}
|
||||
setupContainer()
|
||||
|
||||
let wheelDeltaDirection
|
||||
let wheelDeltaCounter = 0
|
||||
|
||||
return thisObject
|
||||
|
||||
function setupContainer () {
|
||||
@@ -250,6 +254,37 @@ function newTimeFrameScale () {
|
||||
|
||||
function onMouseWheel (event) {
|
||||
delta = event.wheelDelta
|
||||
|
||||
if (IS_MAC) {
|
||||
if (delta < 0) {
|
||||
if (wheelDeltaDirection === -1) {
|
||||
wheelDeltaCounter++
|
||||
if (wheelDeltaCounter < 5) {
|
||||
return
|
||||
} else {
|
||||
wheelDeltaCounter = 0
|
||||
}
|
||||
} else {
|
||||
wheelDeltaCounter = 0
|
||||
wheelDeltaDirection = -1
|
||||
return
|
||||
}
|
||||
} else {
|
||||
if (wheelDeltaDirection === 1) {
|
||||
wheelDeltaCounter++
|
||||
if (wheelDeltaCounter < 5) {
|
||||
return
|
||||
} else {
|
||||
wheelDeltaCounter = 0
|
||||
}
|
||||
} else {
|
||||
wheelDeltaCounter = 0
|
||||
wheelDeltaDirection = 1
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (delta < 0) {
|
||||
timeFrameIndex--
|
||||
if (timeFrameIndex < 0) {
|
||||
|
||||
Reference in new issue
Block a user