From 4ba63819c301e9c9d567aced7333f1c0711c8aa3 Mon Sep 17 00:00:00 2001 From: Luis Fernando Molina Date: Mon, 19 Oct 2020 19:12:36 +0200 Subject: [PATCH] coordinateTransformations --- Candles.js | 16 ++++++++-------- Volumes.js | 20 ++++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/Candles.js b/Candles.js index 0f522eef5..0631a72cf 100644 --- a/Candles.js +++ b/Candles.js @@ -512,10 +512,10 @@ candle.candlePoint3 = coordinateSystem.transformThisPoint(candle.candlePoint3); candle.candlePoint4 = coordinateSystem.transformThisPoint(candle.candlePoint4); - candle.candlePoint1 = transformThisPoint(candle.candlePoint1, thisObject.container); - candle.candlePoint2 = transformThisPoint(candle.candlePoint2, thisObject.container); - candle.candlePoint3 = transformThisPoint(candle.candlePoint3, thisObject.container); - candle.candlePoint4 = transformThisPoint(candle.candlePoint4, thisObject.container); + candle.candlePoint1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint1, thisObject.container); + candle.candlePoint2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint2, thisObject.container); + candle.candlePoint3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint3, thisObject.container); + candle.candlePoint4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.candlePoint4, thisObject.container); /* Skip the first candle with zero at open */ if (candle.open === 0) { continue } @@ -551,10 +551,10 @@ candle.stickPoint3 = coordinateSystem.transformThisPoint(candle.stickPoint3); candle.stickPoint4 = coordinateSystem.transformThisPoint(candle.stickPoint4); - candle.stickPoint1 = transformThisPoint(candle.stickPoint1, thisObject.container); - candle.stickPoint2 = transformThisPoint(candle.stickPoint2, thisObject.container); - candle.stickPoint3 = transformThisPoint(candle.stickPoint3, thisObject.container); - candle.stickPoint4 = transformThisPoint(candle.stickPoint4, thisObject.container); + candle.stickPoint1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint1, thisObject.container); + candle.stickPoint2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint2, thisObject.container); + candle.stickPoint3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint3, thisObject.container); + candle.stickPoint4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(candle.stickPoint4, thisObject.container); if (UI.projects.superalgos.spaces.chartingSpace.viewport.zoomTargetLevel < ZOOM_OUT_THRESHOLD_FOR_PACKING_OBJECTS_AT_THE_BOTTOM_OR_TOP_OF_VIEWPORT) { let diffA = candle.stickPoint3.y - UI.projects.superalgos.spaces.chartingSpace.viewport.visibleArea.bottomLeft.y diff --git a/Volumes.js b/Volumes.js index 1affc8581..7f0fc4688 100644 --- a/Volumes.js +++ b/Volumes.js @@ -460,8 +460,8 @@ /* Now the transformations. */ - frameCorner1 = transformThisPoint(frameCorner1, thisObject.container.frame.container); - frameCorner2 = transformThisPoint(frameCorner2, thisObject.container.frame.container); + frameCorner1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(frameCorner1, thisObject.container.frame.container); + frameCorner2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(frameCorner2, thisObject.container.frame.container); let frameHeightInViewPort = frameCorner2.y - frameCorner1.y; @@ -503,10 +503,10 @@ volumePointA3 = plot.transformThisPoint(volumePointA3); volumePointA4 = plot.transformThisPoint(volumePointA4); - volumePointA1 = transformThisPoint(volumePointA1, thisObject.container); - volumePointA2 = transformThisPoint(volumePointA2, thisObject.container); - volumePointA3 = transformThisPoint(volumePointA3, thisObject.container); - volumePointA4 = transformThisPoint(volumePointA4, thisObject.container); + volumePointA1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA1, thisObject.container); + volumePointA2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA2, thisObject.container); + volumePointA3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA3, thisObject.container); + volumePointA4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointA4, thisObject.container); let baseIncrement = (volumePointA3.x - volumePointA1.x) * WIDHTER_VOLUME_BAR_BASE_FACTOR; @@ -563,10 +563,10 @@ volumePointB3 = plot.transformThisPoint2(volumePointB3); volumePointB4 = plot.transformThisPoint2(volumePointB4); - volumePointB1 = transformThisPoint(volumePointB1, thisObject.container); - volumePointB2 = transformThisPoint(volumePointB2, thisObject.container); - volumePointB3 = transformThisPoint(volumePointB3, thisObject.container); - volumePointB4 = transformThisPoint(volumePointB4, thisObject.container); + volumePointB1 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB1, thisObject.container); + volumePointB2 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB2, thisObject.container); + volumePointB3 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB3, thisObject.container); + volumePointB4 = UI.projects.superalgos.utilities.coordinateTransformations.transformThisPoint(volumePointB4, thisObject.container); } calculateSells(coordinateSystem, thisObject.container.frame.height); // We try to see if it fits in the visible area.