Bug fixes

This commit is contained in:
Luis Fernando Molina committed 2020-03-24 21:06:20 +01:00
1 parent b99038fa36
commit 3b6e1e216e
4 files changed
+23 -7

No files matched your search

+3 -3
View File
@@ -806,7 +806,7 @@
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "code",
"propertyToCheckFor": "javascriptCode",
"label": "Add Code",
"relatedUiObject": "Javascript Code",
"actionFunction": "payload.onMenuItemClick"
@@ -3305,7 +3305,7 @@
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "code",
"propertyToCheckFor": "javascriptCode",
"label": "Add Code",
"relatedUiObject": "Javascript Code",
"actionFunction": "payload.onMenuItemClick"
@@ -3343,7 +3343,7 @@
{
"action": "Add UI Object",
"disableIfPropertyIsDefined": true,
"propertyToCheckFor": "code",
"propertyToCheckFor": "javascriptCode",
"label": "Add Code",
"relatedUiObject": "Javascript Code",
"actionFunction": "payload.onMenuItemClick"
@@ -105,6 +105,10 @@ function newCoordinateSystem () {
/* Reseting this to start over at each cycle. */
noXValueReported = true
if (mustRecalculate === true) {
thisObject.eventHandler.raiseEvent('X-Range Changed')
}
}
if ((thisObject.autoMinYScale === true || thisObject.autoMaxYScale === true) && noYValueReported === false) {
+12
View File
@@ -43,6 +43,7 @@ function newTimelineChart () {
let timeFrameScaleEventSuscriptionId
let timeFrameScaleMouseOverEventSuscriptionId
let scaleChangedEventSubscriptionId
let xRangeChangedEventSubscriptionId
let drawScales = false
let mouse = {
@@ -63,6 +64,7 @@ function newTimelineChart () {
function finalize () {
coordinateSystem.eventHandler.stopListening(scaleChangedEventSubscriptionId)
timelineChartCoordinateSystem.eventHandler.stopListening(xRangeChangedEventSubscriptionId)
if (thisObject.layersManager !== undefined) {
finalizeLayersManager()
@@ -145,6 +147,7 @@ function newTimelineChart () {
onMouseOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseOver', onMouseOver)
onMouseNotOverEventSuscriptionId = thisObject.container.eventHandler.listenToEvent('onMouseNotOver', onMouseNotOver)
scaleChangedEventSubscriptionId = timeMachineCoordinateSystem.eventHandler.listenToEvent('Scale Changed', onScaleChanged)
xRangeChangedEventSubscriptionId = timelineChartCoordinateSystem.eventHandler.listenToEvent('X-Range Changed', xRangeChanged)
}
function initializeCoordinateSystem () {
@@ -231,6 +234,15 @@ function newTimelineChart () {
}
}
function xRangeChanged (event) {
if (thisObject.rateScale !== undefined) {
/* We need to re trasmit the changes on the x Range of the timelinechart coordinate system to the time machine coordinate system so that its scale is syncronized. */
timeMachineCoordinateSystem.min.x = timelineChartCoordinateSystem.min.x
timeMachineCoordinateSystem.max.x = timelineChartCoordinateSystem.max.x
timeMachineCoordinateSystem.recalculateScale()
}
}
function onScaleChanged (event) {
if (thisObject.rateScale !== undefined) {
thisObject.rateScale.onUpstreamScaleChanged(event)
+4 -4
View File
@@ -61,7 +61,7 @@ function newViewport () {
/* Initial default value */
thisObject.zoomLevel = MIN_ZOOM_LEVEL
thisObject.zoomTargetLevel = MIN_ZOOM_LEVEL
thisObject.zoomTargetLevel = Math.round(MIN_ZOOM_LEVEL)
INITIAL_TIME_PERIOD = recalculatePeriod(thisObject.zoomLevel)
let overrideMousePositionCounter = 0
@@ -144,7 +144,7 @@ function newViewport () {
}
function zoomAtCenter (level) {
thisObject.zoomTargetLevel = level
thisObject.zoomTargetLevel = Math.round(level)
overrideMousePositionCounter = 50
ANIMATION_INCREMENT = 0.5
}
@@ -220,7 +220,7 @@ function newViewport () {
if (thisObject.zoomTargetLevel + amount * morePower < MIN_ZOOM_LEVEL) {
return false
}
thisObject.zoomTargetLevel = Math.round((thisObject.zoomTargetLevel + amount * morePower) * MAC_AMOUNT_FACTOR) / MAC_AMOUNT_FACTOR
thisObject.zoomTargetLevel = Math.round(Math.round((thisObject.zoomTargetLevel + amount * morePower) * MAC_AMOUNT_FACTOR) / MAC_AMOUNT_FACTOR)
ANIMATION_INCREMENT = Math.round(Math.abs(thisObject.zoomTargetLevel - thisObject.zoomLevel) / ANIMATION_STEPS * 100) / 100
@@ -398,7 +398,7 @@ function newViewport () {
function newZoomLevel (level) {
thisObject.zoomLevel = Math.round(level)
thisObject.zoomTargetLevel = level
thisObject.zoomTargetLevel = Math.round(level)
INITIAL_TIME_PERIOD = recalculatePeriod(level)
saveObjectState()
ANIMATION_INCREMENT = 0