freealise commited on
Commit
ad925c1
1 Parent(s): 2f22a9e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -5
app.py CHANGED
@@ -482,8 +482,8 @@ with gr.Blocks(css=css) as demo:
482
  if (x < 0) { x = 0; } else if (x > 255) { x = 255; }
483
  if (y < 0) { y = 0; } else if (y > 255) { y = 255; }
484
 
485
- BABYLON.Engine.LastCreatedScene.getNodes()[document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value+1].position.x = x-128;
486
- BABYLON.Engine.LastCreatedScene.getNodes()[document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value+1].position.y = y-128;
487
 
488
  xold = x;
489
  yold = y;
@@ -504,10 +504,9 @@ with gr.Blocks(css=css) as demo:
504
  this.title = xold+\",\"+yold;
505
  }
506
  this.onclick = function(event) {
507
- alert(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value);
508
  try{
509
- BABYLON.Engine.LastCreatedScene.getNodes()[document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value+1].rotation.y = parseInt(event.clientX - event.target.getBoundingClientRect().x-128)/128*Math.PI;
510
- alert(BABYLON.Engine.LastCreatedScene.getNodes()[document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value+1]);
511
  }catch(e){alert(e);}
512
  }
513
  }
 
482
  if (x < 0) { x = 0; } else if (x > 255) { x = 255; }
483
  if (y < 0) { y = 0; } else if (y > 255) { y = 255; }
484
 
485
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = x-128;
486
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.y = y-128;
487
 
488
  xold = x;
489
  yold = y;
 
504
  this.title = xold+\",\"+yold;
505
  }
506
  this.onclick = function(event) {
507
+ alert(BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1]);
508
  try{
509
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.y = parseInt(event.clientX - event.target.getBoundingClientRect().x-128)/128*Math.PI;
 
510
  }catch(e){alert(e);}
511
  }
512
  }