Merge pull request #68 from ngradwohl/bugfix/65_fix_loop

Bugfix/65 fix loop
This commit is contained in:
Лu Лinveгa 2019-07-21 22:25:20 +12:00 committed by GitHub
commit bb6b4f15d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 3 deletions

View File

@ -31,11 +31,23 @@ function Commander (ronin) {
this.hide() this.hide()
} }
this._current_txt = ''
this.run = (txt = this._input.value) => { this.run = (txt = this._input.value) => {
if (txt.indexOf('$') > -1) { ronin.log('Present: $'); return } if (txt.indexOf('$') > -1) { ronin.log('Present: $'); return }
this._current_txt = txt;
if ( ronin.always !== true ) {
ronin.surface.maximize() ronin.surface.maximize()
ronin.interpreter.run(txt) ronin.interpreter.run(this._current_txt)
ronin.always === true && requestAnimationFrame(() => this.run(txt)) }
}
this.loop = () => {
ronin.surface.maximize()
ronin.interpreter.run(this._current_txt)
ronin.always === true && requestAnimationFrame(() => this.loop())
} }
this.load = function (txt) { this.load = function (txt) {

View File

@ -64,7 +64,7 @@ function Ronin () {
this.animate = (b = true) => { this.animate = (b = true) => {
if (this.always === b) { return } if (this.always === b) { return }
this.always = b this.always = b
this.commander.run() this.commander.loop()
} }
// Zoom // Zoom