From 58e1fca1889806665b7b8911dafbe77b2084673f Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 20 May 2019 12:14:33 +0200 Subject: [PATCH] BUG FIXed: Resize event implemented on chart space --- Spaces/ChartSpace.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Spaces/ChartSpace.js b/Spaces/ChartSpace.js index 2973b1706..5820e17e2 100644 --- a/Spaces/ChartSpace.js +++ b/Spaces/ChartSpace.js @@ -32,6 +32,8 @@ function newChartSpace () { thisObject.container.isDraggeable = false thisObject.container.isWheelable = false + let canvasBrowserResizedEventSubscriptionId + return thisObject function finalize () { @@ -40,6 +42,8 @@ function newChartSpace () { timeMachine.finalize() } + thisObject.container.eventHandler.stopListening(canvasBrowserResizedEventSubscriptionId) + thisObject.container.finalize() thisObject.container = undefined } @@ -48,6 +52,8 @@ function newChartSpace () { let initializedCounter = 0 let toInitialize = 1 + canvasBrowserResizedEventSubscriptionId = window.canvasApp.eventHandler.listenToEvent('Browser Resized', resize) + /* We create the first of many possible time machines that could live at the Chart Space. */ let timeMachine = newTimeMachine() @@ -101,6 +107,11 @@ function newChartSpace () { } } + function resize () { + thisObject.container.frame.width = browserCanvas.width + thisObject.container.frame.height = COCKPIT_SPACE_POSITION + } + function fitIntoVisibleArea (point) { /* Here we check the boundaries of the resulting points, so they dont go out of the visible area. */