diff --git a/exec/dorkit/graphic.js b/exec/dorkit/graphic.js index 1cafa525195ce1a2f7837b90f875f80801a98cab..01e1a57fc913e437d84e45ed406f751fa4d73c50 100644 --- a/exec/dorkit/graphic.js +++ b/exec/dorkit/graphic.js @@ -471,9 +471,9 @@ Graphic.prototype.draw = function(xpos,ypos,width,height,xoff,yoff) var ch; if(xpos==undefined) - xpos=1; + xpos=0; if(ypos==undefined) - ypos=1; + ypos=0; if(width==undefined) width=this.width; if(height==undefined) diff --git a/exec/dorkit/jsexec_console.js b/exec/dorkit/jsexec_console.js index 728567e67c4c24d1fe8bee2a9af79ea0fbefae4b..b1df0f3aed1e64cfa5d20a0db668ac2da33f20f0 100644 --- a/exec/dorkit/jsexec_console.js +++ b/exec/dorkit/jsexec_console.js @@ -1,10 +1,10 @@ /* - * Clears the current screen to black and moves to location 1,1 + * Clears the current screen and moves to location 1,1 */ dk.console.remote_io = { clear:function() { - this.print("\x0c"); + this.print("\x1b[2J\x1b[1;1H"); }, /* diff --git a/exec/dorkit/screen.js b/exec/dorkit/screen.js index 5199ae1e46bbd6f8a98d9c56a2184fb052f7996e..3beeb3dc800953094bcc6343a66b015588e29456 100644 --- a/exec/dorkit/screen.js +++ b/exec/dorkit/screen.js @@ -17,7 +17,7 @@ function Screen(w, h, attr, fill) this.graphic = new Graphic(w, h, attr, fill); this.escbuf = ''; this.pos = {x:0, y:0}; - this.stored_pos = {x:0, y:0}; + this.saved_pos = {x:0, y:0}; this.attr = new Attribute(7); } Screen.ANSIRe = /^(.*?)\x1b\[([<-\?]{0,1})([0-;]*)([ -\/]*)([@-~])([\x00-\xff]*)$/; @@ -176,9 +176,9 @@ Screen.prototype.print=function(str) { case 'H': // Cursor position case 'f': param_defaults(p, [1,1]); - if (p[0] >= 0 && p[0] < this.graphic.height && p[1] >= 0 && p[1] <= this.graphic.width) { - this.pos.x = p[1]; - this.pos.y = p[0]; + if (p[0] >= 1 && p[0] < this.graphic.height && p[1] >= 1 && p[1] <= this.graphic.width) { + this.pos.x = p[1]-1; + this.pos.y = p[0]-1; } break; case 'J': // Erase in screen