diff --git a/CockpitSpace/AssetBalances.js b/CockpitSpace/AssetBalances.js index 6cb267ef4..166a68880 100644 --- a/CockpitSpace/AssetBalances.js +++ b/CockpitSpace/AssetBalances.js @@ -1,5 +1,5 @@ -function newQuotedAssetalances () { +function newAssetalances () { const MODULE_NAME = 'Asset Balances' let thisObject = { @@ -38,6 +38,9 @@ function newQuotedAssetalances () { let speedometer = newSpeedometer() speedometer.initialize() + speedometer.container.connectToParent(thisObject.container) + speedometer.container.frame.position.x = thisObject.container.frame.width / 2 + speedometer.container.frame.position.y = thisObject.container.frame.height * (2 + i * 2) / 5 thisObject.speedometers.push(speedometer) } } diff --git a/CockpitSpace/Speedometer.js b/CockpitSpace/Speedometer.js index 7a2f0a857..499b08a42 100644 --- a/CockpitSpace/Speedometer.js +++ b/CockpitSpace/Speedometer.js @@ -56,10 +56,12 @@ function newSpeedometer () { const OPACITY = 1 let centerPoint = { - x: thisObject.params.LEFT_OFFSET, - y: COCKPIT_SPACE_POSITION - COCKPIT_SPACE_HEIGHT / 2 - 9 + x: 0, + y: 0 } + centerPoint = thisObject.container.frame.frameThisPoint(centerPoint) + browserCanvasContext.beginPath() browserCanvasContext.arc(centerPoint.x, centerPoint.y, RADIUS + RED_LINE_HIGHT, 0.85 * Math.PI, 2.15 * Math.PI) browserCanvasContext.closePath() diff --git a/Spaces/CockpitSpace.js b/Spaces/CockpitSpace.js index 01fea0e08..3291428ec 100644 --- a/Spaces/CockpitSpace.js +++ b/Spaces/CockpitSpace.js @@ -5,7 +5,6 @@ let thisObject = { container: undefined, status: 'BOTTOM', - assetBalances: undefined, fullscreen: undefined, toTop: toTop, toBottom: toBottom, @@ -40,7 +39,6 @@ thisObject.container.finalize() thisObject.container = undefined - thisObject.assetBalances = undefined thisObject.fullscreen = undefined } @@ -65,9 +63,6 @@ canvasBrowserResizedEventSubscriptionId = canvas.eventHandler.listenToEvent('Browser Resized', resize) selfMouseClickEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseClick', onMouseClick) - thisObject.assetBalances = newQuotedAssetalances() - thisObject.assetBalances.initialize() - thisObject.fullscreen = newFullScreen() thisObject.fullscreen.container.connectToParent(thisObject.container) thisObject.fullscreen.initialize() @@ -185,7 +180,6 @@ drawBackground() - thisObject.assetBalances.draw() // thisObject.fullscreen.draw() }