Skip to content
Snippets Groups Projects
Commit 8905f847 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Add auto_extend option

If set to true, when setting the ANSI property, rather than throwing away
vertically "scrolled" lines, just keep extending the height to accommodate the
new required vertical size (height).
parent 95101b0b
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
......@@ -61,6 +61,12 @@ function Graphic(w,h,attr,ch, dw)
}
}
Graphic.prototype.extend = function() {
for(var x = 0; x < this.width; x++)
this.data[x][this.height] = new this.Cell(this.ch,this.attribute);
this.height++;
}
/*
* Default to not DoorWay mode, allow it to be overridden per object, or
* globally.
......@@ -392,8 +398,12 @@ Object.defineProperty(Graphic.prototype, "ANSI", {
y++;
}
while(y >= this.height) {
this.scroll();
y--;
if(this.auto_extend === true)
this.extend();
else {
this.scroll();
y--;
}
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment