From e2b58d22560b742f7b404baf4fa75452c34df4c4 Mon Sep 17 00:00:00 2001 From: n0m1s Date: Thu, 27 Feb 2020 22:24:36 +0100 Subject: [PATCH] bugfix: wrong illumination/canvas transformations --- html/illumination_curve.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/html/illumination_curve.js b/html/illumination_curve.js index e11466a..329bd09 100644 --- a/html/illumination_curve.js +++ b/html/illumination_curve.js @@ -15,8 +15,8 @@ class IlluminationPoint { static fromCanvas(x, y) { var ret = new IlluminationPoint(); - ret._u = 1 - (x/canvasParams.h); - ret._v = y/canvasParams.w; + ret._u = x/canvasParams.w; + ret._v = 1 - (y/canvasParams.h); return ret; } @@ -31,11 +31,11 @@ class IlluminationPoint { } get x() { - return (1-this._u) * canvasParams.w; + return this._u * canvasParams.w; } get y() { - return this._v * canvasParams.h; + return (1-this._v) * canvasParams.h; } get u() {