Bug Fixes

This commit is contained in:
Luis Fernando Molina committed 2020-02-12 21:53:39 +01:00
1 parent 2fc39c76e8
commit cffeb5c16a
3 files changed
+32 -29

No files matched your search

+28 -28
View File
@@ -63,7 +63,7 @@ function newTimelineChart () {
}
function finalize () {
coordinateSystem.eventHandler.stopListening(timelineChartCoordinateSystem)
coordinateSystem.eventHandler.stopListening(scaleChangedEventSubscriptionId)
if (thisObject.layersManager !== undefined) {
finalizeLayersManager()
@@ -131,8 +131,8 @@ function newTimelineChart () {
/* Resets the local container with the dimessions of its parent, the Time Machine */
thisObject.container.frame.position.x = 0
thisObject.container.frame.position.y = 0
thisObject.container.frame.height = TIME_MACHINE_HEIGHT
thisObject.container.frame.width = TIME_MACHINE_WIDTH
thisObject.container.frame.height = thisObject.container.parentContainer.frame.height
thisObject.container.frame.width = thisObject.container.parentContainer.frame.width
}
function initialize (pTimeMachineCoordinateSystem) {
@@ -140,7 +140,7 @@ function newTimelineChart () {
timeMachineCoordinateSystem = pTimeMachineCoordinateSystem
coordinateSystem = timeMachineCoordinateSystem
onScaleChanged()
initializeCoordinateSystem()
timeFrame = INITIAL_TIME_PERIOD
@@ -149,6 +149,30 @@ function newTimelineChart () {
scaleChangedEventSubscriptionId = timeMachineCoordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
}
function initializeCoordinateSystem () {
let minValue = {
x: timeMachineCoordinateSystem.min.x,
y: 0
}
let maxValue = {
x: timeMachineCoordinateSystem.max.x,
y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4
}
if (thisObject.rateScale !== undefined) {
minValue.y = thisObject.rateScale.minValue
maxValue.y = thisObject.rateScale.maxValue
}
timelineChartCoordinateSystem.initialize(
minValue,
maxValue,
thisObject.container.frame.width,
thisObject.container.frame.height
)
}
function initializeLayersManager () {
let owner = thisObject.payload.node.payload.parentNode.id // The real owner is the Time Machine
layersPanelHandle = canvas.panelsSpace.createNewPanel('Layers Panel', undefined, owner)
@@ -377,28 +401,4 @@ function newTimelineChart () {
function drawChartsBackground () {
drawContainerBackground(thisObject.container, UI_COLOR.WHITE, 0, thisObject.fitFunction)
}
function recalculateCoordinateSystem () {
let minValue = {
x: timelineChartCoordinateSystem.min.x,
y: 0
}
let maxValue = {
x: timelineChartCoordinateSystem.max.x,
y: nextPorwerOf10(MAX_DEFAULT_RATE_SCALE_VALUE) / 4
}
if (thisObject.rateScale !== undefined) {
minValue.y = thisObject.rateScale.minValue
maxValue.y = thisObject.rateScale.maxValue
}
timelineChartCoordinateSystem.initialize(
minValue,
maxValue,
thisObject.container.frame.width,
thisObject.container.frame.height
)
}
}
+1 -1
View File
@@ -209,7 +209,7 @@ We define here the size of the chartSpace. It has to bee enough big in order to
*/
const TIME_MACHINE_WIDTH = 250;
const TIME_MACHINE_HEIGHT = 250 / 50;
const TIME_MACHINE_HEIGHT = 50;
let mediaRecorder // to downloadText canvas animation as a mediaRecorder
let areWeRecording = false
+3
View File
@@ -342,6 +342,8 @@ function newRateScale () {
function drawScaleBox () {
if (thisObject.rate === undefined) { return }
if (thisObject.payload === undefined) { return }
if (thisObject.payload.node === undefined) { return }
let rate = thisObject.rate
@@ -357,6 +359,7 @@ function newRateScale () {
let label1 = thisObject.payload.node.payload.parentNode.name
let label2 = (Math.trunc(rate)).toLocaleString()
let label3 = labelArray[1]
if (label3 === undefined) { label3 = '00' }
let icon1 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.payload.parentNode.type)
let icon2 = canvas.designerSpace.iconByUiObjectType.get(thisObject.payload.node.type)