Browse Source

bugfix: wrong illumination/canvas transformations

master
n0m1s 6 years ago
parent
commit
e2b58d2256
Signed by: nomis GPG Key ID: BC0454CAD76FE803
1 changed files with 4 additions and 4 deletions
  1. +4
    -4
      html/illumination_curve.js

+ 4
- 4
html/illumination_curve.js View File

@ -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() {


Loading…
Cancel
Save