freealise commited on
Commit
e7dfbcf
1 Parent(s): feaa805

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
app.py CHANGED
@@ -363,12 +363,14 @@ with gr.Blocks(css=css) as demo:
363
  document.getElementById(\"pl\").setAttribute(\"points\", pts.slice(0,-1));
364
  var xold = 0;
365
  var yold = 0;
 
 
366
  function lerp(y1, y2, mu) { return y1*(1-mu)+y2*mu; }
367
 
368
  this.onpointermove = function(event) {
369
  if (this.title != \"\") {
370
- var x = parseInt(event.clientX - event.target.getBoundingClientRect().x);
371
- var y = parseInt(event.clientY - event.target.getBoundingClientRect().y);
372
  if (x < 0) { x = 0; } else if (x > 255) { x = 255; }
373
  if (y < 0) { y = 0; } else if (y > 31) { y = 31; }
374
  var pl_a = document.getElementById(\"pl\").getAttribute(\"points\").split(\" \");
 
363
  document.getElementById(\"pl\").setAttribute(\"points\", pts.slice(0,-1));
364
  var xold = 0;
365
  var yold = 0;
366
+ var x = 0;
367
+ var y = 0;
368
  function lerp(y1, y2, mu) { return y1*(1-mu)+y2*mu; }
369
 
370
  this.onpointermove = function(event) {
371
  if (this.title != \"\") {
372
+ x = parseInt(event.clientX - event.target.getBoundingClientRect().x);
373
+ y = parseInt(event.clientY - event.target.getBoundingClientRect().y);
374
  if (x < 0) { x = 0; } else if (x > 255) { x = 255; }
375
  if (y < 0) { y = 0; } else if (y > 31) { y = 31; }
376
  var pl_a = document.getElementById(\"pl\").getAttribute(\"points\").split(\" \");