Switching between Time Machines working on every scale
This commit is contained in:
1 parent
fbac0a5704
commit
4a384a0ff5
4 files changed
+12
-4
No files matched your search
@@ -177,7 +177,7 @@ function newTimeMachine () {
|
||||
return thisObject.container
|
||||
} else {
|
||||
if (purpose === GET_CONTAINER_PURPOSE.MOUSE_OVER) {
|
||||
thisObject.container.eventHandler.raiseEvent('onMouseNotOverMe')
|
||||
thisObject.container.eventHandler.raiseEvent('onMouseNotOver')
|
||||
if (thisObject.timeScale !== undefined) {
|
||||
thisObject.timeScale.visible = false
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ function newRateScale () {
|
||||
}
|
||||
|
||||
function onMouseOver () {
|
||||
thisObject.visible = true
|
||||
isMouseOver = true
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@ function newTimeFrameScale () {
|
||||
|
||||
let onMouseWheelEventSubscriptionId
|
||||
let onZoomChangedEventSubscriptionId
|
||||
let onMouseOverEventSubscriptionId
|
||||
|
||||
setupContainer()
|
||||
return thisObject
|
||||
@@ -36,6 +37,7 @@ function newTimeFrameScale () {
|
||||
thisObject.container.isDraggeable = false
|
||||
thisObject.container.isClickeable = false
|
||||
thisObject.container.isWheelable = true
|
||||
thisObject.container.detectMouseOver = true
|
||||
|
||||
thisObject.container.frame.width = 190
|
||||
thisObject.container.frame.height = 25
|
||||
@@ -44,6 +46,7 @@ function newTimeFrameScale () {
|
||||
function finalize () {
|
||||
thisObject.container.eventHandler.stopListening(onMouseWheelEventSubscriptionId)
|
||||
viewPort.eventHandler.stopListening(onZoomChangedEventSubscriptionId)
|
||||
thisObject.container.eventHandler.stopListening(onMouseOverEventSubscriptionId)
|
||||
|
||||
objectStorage = undefined
|
||||
|
||||
@@ -53,12 +56,16 @@ function newTimeFrameScale () {
|
||||
}
|
||||
|
||||
function initialize () {
|
||||
onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
|
||||
|
||||
readObjectState()
|
||||
newTimeFrame()
|
||||
|
||||
onMouseWheelEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseWheel', onMouseWheel)
|
||||
onZoomChangedEventSubscriptionId = viewPort.eventHandler.listenToEvent('Zoom Changed', onZoomChanged)
|
||||
onMouseOverEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
|
||||
|
||||
function onMouseOver () {
|
||||
thisObject.visible = true
|
||||
}
|
||||
}
|
||||
|
||||
function physics () {
|
||||
|
||||
+1
-1
@@ -65,6 +65,7 @@ function newTimeScale () {
|
||||
}
|
||||
|
||||
function onMouseOver () {
|
||||
thisObject.visible = true
|
||||
isMouseOver = true
|
||||
}
|
||||
|
||||
@@ -216,4 +217,3 @@ function newTimeScale () {
|
||||
drawScaleDisplay(label1, label2, 10, 60, thisObject.container, thisObject.fitFunction)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user