Skip to content

Commit

Permalink
Fix/max bias (#274)
Browse files Browse the repository at this point in the history
* fix: bias widget now uses a max absolute value of 200

* chore: use max bias as a const instead of hardcoding
  • Loading branch information
al3xknutsen authored Nov 20, 2019
1 parent 0206020 commit 037719c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/VideoComponents/BiasWidget.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import './css/BiasWidget.css';

const initialWidth = 360;
const initialHeight = 360;
const maxBias = 200.0;

class BiasWidget extends CanvasWidget {
constructor(props) {
Expand All @@ -20,9 +21,9 @@ class BiasWidget extends CanvasWidget {
var { u, v, w } = this.props;

// Normalize bias values
u = mapRange(u, -400.0, 400.0, -1.0, 1.0);
v = mapRange(v, -400.0, 400.0, -1.0, 1.0);
w = mapRange(w, -400.0, 400.0, -1.0, 1.0);
u = mapRange(u, -maxBias, maxBias, -1.0, 1.0);
v = mapRange(v, -maxBias, maxBias, -1.0, 1.0);
w = mapRange(w, -maxBias, maxBias, -1.0, 1.0);

drawBias(this.ctx, u, v, w, initialWidth, initialHeight);
}
Expand Down

0 comments on commit 037719c

Please sign in to comment.