freealise commited on
Commit
82e74d7
1 Parent(s): 9f0f591

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -468,7 +468,7 @@ with gr.Blocks(css=css) as demo:
468
  if (document.getElementById(\"cr\").getAttribute(\"stroke\") == \"none\") {
469
  if (x > 255 && xold > 255) {
470
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.y = 256-y-128;
471
- document.getElementById(\"cr\").setAttribute(\"r\", 256-y);
472
  } else {
473
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = x-128;
474
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.z = y-128;
@@ -481,8 +481,8 @@ with gr.Blocks(css=css) as demo:
481
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.y = (y-128)/128*Math.PI;
482
  document.getElementById(\"rg\").setAttribute(\"r\", (256-y)/256*100+\"%\");
483
  } else {
484
- BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.z = (x-128)/128*Math.PI;
485
- BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.x = (y-128)/128*Math.PI;
486
  document.getElementById(\"rg\").setAttribute(\"cx\", x/256*100+\"%\");
487
  document.getElementById(\"rg\").setAttribute(\"cy\", y/256*100+\"%\");
488
  }
@@ -512,7 +512,8 @@ with gr.Blocks(css=css) as demo:
512
  <stop offset='100%' stop-color='black'/>
513
  </radialGradient>
514
  </defs>
515
- <circle cx='127' cy='127' r='32' id='cr' stroke='none' fill='url(#rg)'/>
 
516
  </svg><br/><label for='mode'>Mode </label><select id='mode' onchange='
517
  try {
518
  if (this.selectedIndex == 0) {
 
468
  if (document.getElementById(\"cr\").getAttribute(\"stroke\") == \"none\") {
469
  if (x > 255 && xold > 255) {
470
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.y = 256-y-128;
471
+ document.getElementById(\"cr\").setAttribute(\"r\", (256-y)/2);
472
  } else {
473
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = x-128;
474
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.z = y-128;
 
481
  BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.y = (y-128)/128*Math.PI;
482
  document.getElementById(\"rg\").setAttribute(\"r\", (256-y)/256*100+\"%\");
483
  } else {
484
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.x = (x-128)/128*Math.PI;
485
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].rotation.z = (y-128)/128*Math.PI;
486
  document.getElementById(\"rg\").setAttribute(\"cx\", x/256*100+\"%\");
487
  document.getElementById(\"rg\").setAttribute(\"cy\", y/256*100+\"%\");
488
  }
 
512
  <stop offset='100%' stop-color='black'/>
513
  </radialGradient>
514
  </defs>
515
+ <circle cx='127' cy='127' r='64' id='cr' stroke='none' fill='url(#rg)'/>
516
+ <line x1='256' y1='0' x2='256' y2='256' stroke='black' />
517
  </svg><br/><label for='mode'>Mode </label><select id='mode' onchange='
518
  try {
519
  if (this.selectedIndex == 0) {