Bug Fixed at Plotter when dragging Time Machine container

This commit is contained in:
Luis Fernando Molina committed 2020-01-10 19:54:34 +01:00
1 parent ec521be7c2
commit 90314ffcf2
4 files changed
+22 -15

No files matched your search

+1 -1
View File
@@ -199,7 +199,7 @@ function newPlottersManager () {
plotter = getNewPlotter(pProductCard.product.plotter.dataMine, pProductCard.product.plotter.codeName, pProductCard.product.plotter.moduleName)
}
plotter.container.connectToParent(thisObject.container, true, true, false, true, true, true)
plotter.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
plotter.container.frame.position.x = thisObject.container.frame.width / 2 - plotter.container.frame.width / 2
plotter.container.frame.position.y = thisObject.container.frame.height / 2 - plotter.container.frame.height / 2
plotter.fitFunction = thisObject.fitFunction
+1 -1
View File
@@ -284,7 +284,7 @@ function newTimeMachine () {
timelineChart.payload.uiObject.setValue('Loading...')
/* Setting up the new timeline chart. */
timelineChart.container.connectToParent(thisObject.container, true, true, false, true, true, true)
timelineChart.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
timelineChart.container.fitFunction = thisObject.container.fitFunction
timelineChart.container.frame.height = thisObject.container.frame.height
timelineChart.container.frame.position.x = thisObject.container.frame.width / 2 - timelineChart.container.frame.width / 2
+1 -1
View File
@@ -158,7 +158,7 @@ function newTimelineChart () {
plotterManager = newPlottersManager()
plotterManager.container.connectToParent(thisObject.container, true, true, false, true, true, true)
plotterManager.container.connectToParent(thisObject.container, true, true, false, true, true, true, false, false, true)
plotterManager.container.frame.position.x = 0
plotterManager.container.frame.position.y = 0
+19 -12
View File
@@ -58,6 +58,7 @@ function newPlotter () {
let dimmensionsChangedEventSubscriptionId
let marketFilesUpdatedEventSubscriptionId
let dailyFilesUpdatedEventSubscriptionId
let onDisplaceEventSubscriptionId
let logged = false
return thisObject
@@ -71,6 +72,7 @@ function newPlotter () {
thisObject.container.eventHandler.stopListening(dimmensionsChangedEventSubscriptionId)
marketFiles.eventHandler.stopListening(marketFilesUpdatedEventSubscriptionId)
dailyFiles.eventHandler.stopListening(dailyFilesUpdatedEventSubscriptionId)
thisObject.container.eventHandler.stopListening(onDisplaceEventSubscriptionId)
/* Clear References */
marketFiles = undefined
@@ -120,6 +122,7 @@ function newPlotter () {
dragFinishedEventSubscriptionId = canvas.eventHandler.listenToEvent('Drag Finished', onDragFinished)
marketFilesUpdatedEventSubscriptionId = marketFiles.eventHandler.listenToEvent('Files Updated', onMarketFilesUpdated)
dailyFilesUpdatedEventSubscriptionId = dailyFiles.eventHandler.listenToEvent('Files Updated', onDailyFilesUpdated)
onDisplaceEventSubscriptionId = thisObject.container.eventHandler.listenToEvent('onDisplace', onDisplace)
/* Get ready for plotting. */
recalculate()
@@ -783,20 +786,24 @@ function newPlotter () {
}
}
function onDisplace (event) {
recalculateAll(event)
}
function onOffsetChanged (event) {
try {
mustRecalculateDataPoints = true
if (event !== undefined) {
if (event.recalculate === true) {
recalculate()
return
}
}
if (Math.random() * 100 > 95) {
recalculateAll(event)
}
function recalculateAll (event) {
mustRecalculateDataPoints = true
if (event !== undefined) {
if (event.recalculate === true) {
recalculate()
};
} catch (err) {
if (ERROR_LOG === true) { logger.write('[ERROR] onOffsetChanged -> err = ' + err.stack) }
return
}
}
if (Math.random() * 100 > 95) {
recalculate()
}
}
}