Spaces:
Running
Running
Update app.py
Browse files
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
|
377 |
-
|
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(\" \"));
|