diff --git a/ChartingSpace/CoordinateSystem.js b/ChartingSpace/CoordinateSystem.js index f0bf0f385..830cef1ac 100644 --- a/ChartingSpace/CoordinateSystem.js +++ b/ChartingSpace/CoordinateSystem.js @@ -110,12 +110,12 @@ function newCoordinateSystem () { function reportXValue (value) { if (thisObject.autoMinXScale === true) { - if (value < newXMin) { + if (value < newXMin && value !== 0) { newXMin = value } } if (thisObject.autoMaxXScale === true) { - if (value > newXMax) { + if (value > newXMax && value !== 0) { newXMax = value } } @@ -265,9 +265,18 @@ function newCoordinateSystem () { let max = thisObject.max.x - diff * factor * rightDistance / (container.frame.width / 2) if (min < max) { - thisObject.min.x = min - thisObject.max.x = max - thisObject.recalculateScale() + let mustRecalculate = false + if (thisObject.autoMinXScale === false) { + thisObject.min.x = min + mustRecalculate = true + } + if (thisObject.autoMaxXScale === false) { + thisObject.max.x = max + mustRecalculate = true + } + if (mustRecalculate === true) { + thisObject.recalculateScale() + } } } @@ -280,9 +289,18 @@ function newCoordinateSystem () { let max = thisObject.max.y - diff * factor * topDistance / (container.frame.height / 2) if (min < max) { - thisObject.min.y = min - thisObject.max.y = max - thisObject.recalculateScale() + let mustRecalculate = false + if (thisObject.autoMinYScale === false) { + thisObject.min.y = min + mustRecalculate = true + } + if (thisObject.autoMaxYScale === false) { + thisObject.max.y = max + mustRecalculate = true + } + if (mustRecalculate === true) { + thisObject.recalculateScale() + } } } diff --git a/ChartingSpace/TimelineChart.js b/ChartingSpace/TimelineChart.js index d3aaab942..d270d7b9f 100644 --- a/ChartingSpace/TimelineChart.js +++ b/ChartingSpace/TimelineChart.js @@ -320,11 +320,11 @@ function newTimelineChart () { } function thisObjectPhysics () { - timelineChartCoordinateSystem.reportParentXValue(timeMachineCoordinateSystem.min.x, timeMachineCoordinateSystem.max.x) - timelineChartCoordinateSystem.physics() - /* Only if the plotter manager has some layer turned on, we will pass the min and max upstream. */ if (thisObject.plotterManager !== undefined && thisObject.plotterManager.connectors.length > 0) { + timelineChartCoordinateSystem.reportParentXValue(timeMachineCoordinateSystem.min.x, timeMachineCoordinateSystem.max.x) + timelineChartCoordinateSystem.physics() + timeMachineCoordinateSystem.reportXValue(timelineChartCoordinateSystem.childrenMin.x) timeMachineCoordinateSystem.reportXValue(timelineChartCoordinateSystem.childrenMax.x) } diff --git a/FloatingSpace/FloatingObject.js b/FloatingSpace/FloatingObject.js index 5551c47a9..88cb75b4d 100644 --- a/FloatingSpace/FloatingObject.js +++ b/FloatingSpace/FloatingObject.js @@ -286,6 +286,7 @@ function newFloatingObject () { function positionContraintsPhysics () { const MAX_DISTANCE_TO_PARENT = 3000 + const MIN_DISTANCE_TO_PARENT = 100 if (thisObject.angleToParent !== ANGLE_TO_PARENT.NOT_FIXED && thisObject.isOnFocus !== true) { let parent = thisObject.payload.chainParent @@ -324,6 +325,10 @@ function newFloatingObject () { distanceToParent = MAX_DISTANCE_TO_PARENT } + if (distanceToParent < MIN_DISTANCE_TO_PARENT) { + distanceToParent = MIN_DISTANCE_TO_PARENT + } + switch (thisObject.angleToParent) { case ANGLE_TO_PARENT.RANGE_360: angleToParentAngle = 360