diff --git a/Scales/TimeFrameScale.js b/Scales/TimeFrameScale.js index 9c718e28e..89fdebc8e 100644 --- a/Scales/TimeFrameScale.js +++ b/Scales/TimeFrameScale.js @@ -38,12 +38,6 @@ function newTimeFrameScale () { let limitingContainer - let mouse = { - position: { - x: 0, - y: 0 - } - } setupContainer() let wheelDeltaDirection @@ -76,7 +70,6 @@ function newTimeFrameScale () { thisObject.payload = undefined limitingContainer = undefined - mouse = undefined } function initialize (pLimitingContainer) { @@ -103,12 +96,6 @@ function newTimeFrameScale () { turnOnCounter = 0 } } - mouse = { - position: { - x: event.x, - y: event.y - } - } } function onMouseOver (event) { @@ -201,7 +188,7 @@ function newTimeFrameScale () { } timePoint = transformThisPoint(timePoint, limitingContainer.frame.container) - timePoint.x = mouse.position.x - thisObject.container.frame.width / 2 + timePoint.x = canvas.mouse.position.x - thisObject.container.frame.width / 2 /* Checking against the container limits. */ if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x } diff --git a/Scales/TimeScale.js b/Scales/TimeScale.js index 5ceeb9492..00d52c530 100644 --- a/Scales/TimeScale.js +++ b/Scales/TimeScale.js @@ -42,13 +42,6 @@ function newTimeScale () { let coordinateSystem let limitingContainer - let mouse = { - position: { - x: 0, - y: 0 - } - } - let wheelDeltaDirection let wheelDeltaCounter = 0 @@ -67,7 +60,6 @@ function newTimeScale () { coordinateSystem = undefined limitingContainer = undefined - mouse = undefined autoScaleButton.finalize() autoScaleButton = undefined @@ -101,12 +93,6 @@ function newTimeScale () { turnOnCounter = 0 } } - mouse = { - position: { - x: event.x, - y: event.y - } - } } function onMouseOver (event) { @@ -253,7 +239,7 @@ function newTimeScale () { /* Mouse Position Date Calculation */ let timePoint = { - x: mouse.position.x, + x: canvas.mouse.position.x, y: 0 } @@ -268,7 +254,7 @@ function newTimeScale () { } timePoint = transformThisPoint(timePoint, limitingContainer.frame.container) - timePoint.x = mouse.position.x - thisObject.container.frame.width / 2 + timePoint.x = canvas.mouse.position.x - thisObject.container.frame.width / 2 /* Checking against the container limits. */ if (timePoint.x < upCorner.x) { timePoint.x = upCorner.x }