From fa13576067271dece1dffeebbb9dfd6d816d7a20 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 19 Oct 2020 19:12:05 +0200 Subject: [PATCH] coordinateTransformations --- Frame.js | 34 +++++++++++++++++----------------- Utilities.js | 2 +- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Frame.js b/Frame.js index 2442020df..183539d87 100644 --- a/Frame.js +++ b/Frame.js @@ -67,8 +67,8 @@ function newFrame() { /* Now the transformations. */ - point1 = transformThisPoint(point1, thisObject.container) - point3 = transformThisPoint(point3, thisObject.container) + point1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point1, thisObject.container) + point3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point3, thisObject.container) if (point1.x < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight.x && point1.y < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y && point3.x > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.x && point3.y > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y) { return true @@ -92,8 +92,8 @@ function newFrame() { /* Now the transformations. */ - point1 = transformThisPoint(point1, thisObject.container) - point3 = transformThisPoint(point3, thisObject.container) + point1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point1, thisObject.container) + point3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point3, thisObject.container) if (point1.x < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topRight.x && point1.y < UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomRight.y && point3.x > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.x && point3.y > UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.topLeft.y) { return true @@ -204,7 +204,7 @@ function newFrame() { if (outsideViewPort === true) { checkPoint = thisObject.container.frame.unframeThisPoint(checkPoint) } else { - checkPoint = unTransformThisPoint(checkPoint, thisObject.container) + checkPoint = UI.projects.superalgos.utilities.coordinateTransformations.unTransformThisPoint(checkPoint, thisObject.container) } } @@ -388,10 +388,10 @@ function newFrame() { } /* Now the transformations. */ - point1 = transformThisPoint(point1, thisObject.container) - point2 = transformThisPoint(point2, thisObject.container) - point3 = transformThisPoint(point3, thisObject.container) - point4 = transformThisPoint(point4, thisObject.container) + point1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point1, thisObject.container) + point2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point2, thisObject.container) + point3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point3, thisObject.container) + point4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point4, thisObject.container) if (fitFunction !== undefined) { point1 = fitFunction(point1) @@ -437,8 +437,8 @@ function newFrame() { y: j } - point1 = transformThisPoint(point1, thisObject.container) - point2 = transformThisPoint(point2, thisObject.container) + point1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point1, thisObject.container) + point2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point2, thisObject.container) if (fitFunction !== undefined) { point1 = fitFunction(point1) @@ -459,8 +459,8 @@ function newFrame() { y: thisObject.height } - point3 = transformThisPoint(point3, thisObject.container) - point4 = transformThisPoint(point4, thisObject.container) + point3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point3, thisObject.container) + point4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point4, thisObject.container) if (fitFunction !== undefined) { point3 = fitFunction(point3) @@ -495,8 +495,8 @@ function newFrame() { y: j } - point1 = transformThisPoint(point1, thisObject.container) - point2 = transformThisPoint(point2, thisObject.container) + point1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point1, thisObject.container) + point2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point2, thisObject.container) if (fitFunction !== undefined) { point1 = fitFunction(point1) @@ -517,8 +517,8 @@ function newFrame() { y: thisObject.height } - point3 = transformThisPoint(point3, thisObject.container) - point4 = transformThisPoint(point4, thisObject.container) + point3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point3, thisObject.container) + point4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(point4, thisObject.container) if (fitFunction !== undefined) { point3 = fitFunction(point3) diff --git a/Utilities.js b/Utilities.js index 987207143..a642583ed 100644 --- a/Utilities.js +++ b/Utilities.js @@ -56,7 +56,7 @@ function moveToUserPosition(container, currentDate, currentRate, coordinateSyste /* Put this point in the coordinate system of the UI.projects.superalgos.spaces.chartingSpace.viewport */ targetPoint = coordinateSystem.transformThisPoint(targetPoint) - targetPoint = transformThisPoint(targetPoint, container) + targetPoint = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(targetPoint, container) let displaceVector