freealise commited on
Commit
bc3b79c
1 Parent(s): 812116a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -626,8 +626,8 @@ with gr.Blocks(css=css) as demo:
626
  const y = event.clientY-this.getBoundingClientRect().y-64;
627
  const angle_ = Math.atan2(y, x);
628
  const r = Math.sqrt(Math.pow(y,2) + Math.pow(x,2));
629
- BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.z = r * Math.cos(angle_-angle);
630
- BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = r * Math.sin(angle_-angle);
631
  }
632
  } catch(e) {alert(e)}
633
  ' onkeydown='
@@ -736,7 +736,7 @@ with gr.Blocks(css=css) as demo:
736
  this.value = \"\";
737
  }
738
  }
739
- ' style='float:left;height:128px;width:128px;user-select:none;color:auto;background-color:transparent;border:1px solid gray;'/><pre id='keymap' style='float:right'>
740
  ` 1 2 3 4 5 6 7 8 9 0 - =
741
  W E T Y I O { }
742
  A-`S´-D F-`G´-H J-`K´-L ; '
 
626
  const y = event.clientY-this.getBoundingClientRect().y-64;
627
  const angle_ = Math.atan2(y, x);
628
  const r = Math.sqrt(Math.pow(y,2) + Math.pow(x,2));
629
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.z = r * Math.sin(-angle_-angle);
630
+ BABYLON.Engine.LastCreatedScene.getNodes()[parseInt(document.getElementById(\"fnum\").getElementsByTagName(\"input\")[0].value)+1].position.x = r * Math.cos(-angle_-angle);
631
  }
632
  } catch(e) {alert(e)}
633
  ' onkeydown='
 
736
  this.value = \"\";
737
  }
738
  }
739
+ ' style='float:left;height:128px;width:128px;user-select:none;touch-action:none;color:auto;background-color:transparent;border:1px solid gray;'/><pre id='keymap' style='float:right'>
740
  ` 1 2 3 4 5 6 7 8 9 0 - =
741
  W E T Y I O { }
742
  A-`S´-D F-`G´-H J-`K´-L ; '