Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -356,9 +356,9 @@ with gr.Blocks(css=css) as demo:
|
|
356 |
if (document.getElementById(\"pl\").getAttribute(\"points\").length < 256) {
|
357 |
var pts = \"\";
|
358 |
for (var i=0; i<256; i++) {
|
359 |
-
pts += i+\",\"+Math.sin(i/256*Math.PI/2)*127+\" \";
|
360 |
}
|
361 |
-
document.getElementById(\"pl\").setAttribute(\"points\", pts);
|
362 |
this.onpointermove = function(event) {
|
363 |
if (this.style.borderBottom == \"1px dotted white\") {
|
364 |
var x = parseInt(event.clientX - event.target.getBoundingClientRect().x);
|
|
|
356 |
if (document.getElementById(\"pl\").getAttribute(\"points\").length < 256) {
|
357 |
var pts = \"\";
|
358 |
for (var i=0; i<256; i++) {
|
359 |
+
pts += i+\",\"+parseInt(Math.sin(i/256*Math.PI/2)*127)+\" \";
|
360 |
}
|
361 |
+
document.getElementById(\"pl\").setAttribute(\"points\", pts.slice(0,-1));
|
362 |
this.onpointermove = function(event) {
|
363 |
if (this.style.borderBottom == \"1px dotted white\") {
|
364 |
var x = parseInt(event.clientX - event.target.getBoundingClientRect().x);
|