All working

This commit is contained in:
Luis Fernando Molina committed 2020-04-07 17:11:26 +02:00
1 parent c13f5f45a0
commit c8854b5406
3 files changed
+34 -11

No files matched your search

+26 -8
View File
@@ -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()
}
}
}
+3 -3
View File
@@ -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)
}
+5
View File
@@ -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