freealise commited on
Commit
9270d86
1 Parent(s): d78ecb0

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -4
app.py CHANGED
@@ -373,10 +373,8 @@ with gr.Blocks(css=css) as demo:
373
  if (y < 0) { y = 0; } else if (y > 31) { y = 31; }
374
  var pl_a = document.getElementById(\"pl\").getAttribute(\"points\").split(\" \");
375
 
376
- var minx = Math.min(xold, x);
377
- var maxx = Math.max(xold, x);
378
- for (var i=minx+1; i<maxx; i++) {
379
- pl_a[i] = x+\",\"+parseInt(lerp( yold, y, (i-minx)/(maxx-minx) ));
380
  }
381
  pl_a[x] = x+\",\"+y;
382
  document.getElementById(\"pl\").setAttribute(\"points\", pl_a.join(\" \"));
 
373
  if (y < 0) { y = 0; } else if (y > 31) { y = 31; }
374
  var pl_a = document.getElementById(\"pl\").getAttribute(\"points\").split(\" \");
375
 
376
+ for (var i=Math.min(xold, x)+1; i<Math.max(xold, x); i++) {
377
+ pl_a[i] = x+\",\"+parseInt(lerp( yold, y, (i-xold)/(x-xold) ));
 
 
378
  }
379
  pl_a[x] = x+\",\"+y;
380
  document.getElementById(\"pl\").setAttribute(\"points\", pl_a.join(\" \"));