Commit 8905f847 authored by Rob Swindell's avatar Rob Swindell 💬
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
......@@ -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,11 +398,15 @@ Object.defineProperty(Graphic.prototype, "ANSI", {
y++;
}
while(y >= this.height) {
if(this.auto_extend === true)
this.extend();
else {
this.scroll();
y--;
}
}
}
}
});
// return ctrl-a codes to obtain a certain attribute
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment