diff --git a/.vs/AAWebPlatform/v15/.suo b/.vs/AAWebPlatform/v15/.suo index 8d6679251..7f9750aa9 100644 Binary files a/.vs/AAWebPlatform/v15/.suo and b/.vs/AAWebPlatform/v15/.suo differ diff --git a/ChartGrid.js b/ChartGrid.js index 9601f03de..e1aeee53d 100644 --- a/ChartGrid.js +++ b/ChartGrid.js @@ -476,8 +476,8 @@ y: j }; - point1 = timeLineCoordinateSystem.inverseTransform(point1, container.frame.height); - point2 = timeLineCoordinateSystem.inverseTransform(point2, container.frame.height); + point1 = timeLineCoordinateSystem.transformThisPoint(point1); + point2 = timeLineCoordinateSystem.transformThisPoint(point2); point1 = transformThisPoint(point1, container); point2 = transformThisPoint(point2, container); @@ -540,8 +540,8 @@ y: timeLineCoordinateSystem.max.y }; - point3 = timeLineCoordinateSystem.inverseTransform(point3, container.frame.height); - point4 = timeLineCoordinateSystem.inverseTransform(point4, container.frame.height); + point3 = timeLineCoordinateSystem.transformThisPoint(point3); + point4 = timeLineCoordinateSystem.transformThisPoint(point4); point3 = transformThisPoint(point3, container); point4 = transformThisPoint(point4, container); diff --git a/ProductCard.js b/ProductCard.js index 957bc0f5a..6b73e15d5 100644 --- a/ProductCard.js +++ b/ProductCard.js @@ -1,6 +1,6 @@ function newProductCard() { - const CONSOLE_LOG = true; + const CONSOLE_LOG = false; var thisObject = { container: undefined, diff --git a/TimeLineCoordinateSystem.js b/TimeLineCoordinateSystem.js index 631faad4e..fe4cc88b3 100644 --- a/TimeLineCoordinateSystem.js +++ b/TimeLineCoordinateSystem.js @@ -13,8 +13,8 @@ function newTimeLineCoordinateSystem() { min: undefined, max: undefined, scale: undefined, - inverseTransform: inverseTransform, - inverseTransform2: inverseTransform2, + transformThisPoint: transformThisPoint, + transformThisPoint2: transformThisPoint2, unInverseTransform: unInverseTransform, inverseTransformUncappedY: inverseTransformUncappedY, initializeX: initializeX, @@ -41,9 +41,11 @@ function newTimeLineCoordinateSystem() { thisObject.max = max; thisObject.scale = scale; + let maxHeight; + return thisObject; - function initialize(minValue, maxValue, maxWidth, maxHeight) { + function initialize(minValue, maxValue, maxWidth, pMaxHeight) { /* Defines the min and max value of rate that we are going to transport to the available screen at the center position. */ @@ -56,7 +58,9 @@ function newTimeLineCoordinateSystem() { /* Defines the initial Zoom level at center position. */ thisObject.scale.x = maxWidth / (thisObject.max.x - thisObject.min.x); - thisObject.scale.y = maxHeight / (thisObject.max.y - thisObject.min.y); + thisObject.scale.y = pMaxHeight / (thisObject.max.y - thisObject.min.y); + + maxHeight = pMaxHeight; } @@ -69,32 +73,33 @@ function newTimeLineCoordinateSystem() { } - function initializeY(minValue, maxValue, maxHeight) { + function initializeY(minValue, maxValue, pMaxHeight) { thisObject.min.y = minValue.y; // * 0.999; // 0.1% less thisObject.max.y = maxValue.y; // * 1.001; // 0.1% more - thisObject.scale.y = maxHeight / (thisObject.max.y - thisObject.min.y); + thisObject.scale.y = pMaxHeight / (thisObject.max.y - thisObject.min.y); + maxHeight = pMaxHeight; } - function inverseTransform(point, inverseY) { + function transformThisPoint(point) { point = { x: (point.x - this.min.x) * this.scale.x, - y: inverseY - (point.y - this.min.y) * this.scale.y + y: maxHeight - (point.y - this.min.y) * this.scale.y }; return point; } - function inverseTransform2(point, inverseY) { + function transformThisPoint2(point) { point = { x: (point.x - this.min.x) * this.scale.x, - y: (inverseY - point.y - this.min.y) * this.scale.y + y: (maxHeight- point.y - this.min.y) * this.scale.y }; return point;