Skip to content

Commit

Permalink
Merge pull request #312 from combefis/fixnegvalues
Browse files Browse the repository at this point in the history
Fix negative values handling
  • Loading branch information
robertsLando authored Jul 30, 2019
2 parents f1494ab + e236faa commit bef3f8b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,6 +404,12 @@ JustGage = function(config) {

var alpha, Ro, Ri, Cx, Cy, Xo, Yo, Xi, Yi, path;

if (min < 0) {
max -= min;
value -= min;
min = 0;
}

if (donut) {
alpha = (1 - 2 * (value - min) / (max - min)) * Math.PI;
Ro = w / 2 - w / 30;
Expand Down

0 comments on commit bef3f8b

Please sign in to comment.