From 4e7dd306c437e6a8fc6ecaf79463dc9881aa4a03 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Thu, 16 Jan 2020 11:28:57 +0100 Subject: [PATCH] Bug fixes --- Panels/LayersPanel.js | 10 +++++++++- Spaces/ChartSpace.js | 7 +++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Panels/LayersPanel.js b/Panels/LayersPanel.js index e8a8e9ec3..3ef32dbbd 100644 --- a/Panels/LayersPanel.js +++ b/Panels/LayersPanel.js @@ -27,6 +27,7 @@ function newProductsPanel () { const LAYER_SEPARATION = 0 let panelTabButton + let visible = true let heatherHeight = 60 let footerHeight = 15 let layerHeight = 90 @@ -135,6 +136,13 @@ function newProductsPanel () { function panelSizePhysics () { let viewPortHeight = viewPort.visibleArea.bottomLeft.y - viewPort.visibleArea.topLeft.y + + if (viewPortHeight < heatherHeight) { + visible = false + } else { + visible = true + } + if (desiredPanelHeight > viewPortHeight) { posibleVisibleLayers = Math.trunc((viewPortHeight - heatherHeight - footerHeight) / (layerHeight + LAYER_SEPARATION)) } else { @@ -304,7 +312,7 @@ function newProductsPanel () { } function draw () { - if (isInitialized === false) { return } + if (isInitialized === false || visible === false) { return } // thisObject.container.frame.draw(false, false, false, thisObject.fitFunction) diff --git a/Spaces/ChartSpace.js b/Spaces/ChartSpace.js index 5726e7ebb..a9a2b8118 100644 --- a/Spaces/ChartSpace.js +++ b/Spaces/ChartSpace.js @@ -242,10 +242,14 @@ function newChartSpace () { } function initializeTimeMachine (node, syncWithDesignerLoop) { + if (node.payload === undefined) { return } // not ready to consider this Time Machine + if (node.payload.uiObject === undefined) { return } + let timeMachine = newTimeMachine() timeMachine.syncWithDesignerLoop = syncWithDesignerLoop timeMachine.payload = node.payload timeMachine.nodeId = node.id + timeMachinesMap.set(node.id, timeMachine) timeMachine.payload.uiObject.setValue('Loading...') @@ -282,6 +286,9 @@ function newChartSpace () { function childrenPhysics () { for (let i = 0; i < thisObject.timeMachines.length; i++) { let timeMachine = thisObject.timeMachines[i] + if (timeMachine.payload.node === undefined) { + continue + } if (timeMachine.container.frame.isInViewPort()) { timeMachine.physics()