This commit is contained in:
Christopher Jeffrey 2013-06-11 14:16:19 -05:00
parent 6357b4dfff
commit b4566dc48b
1 changed files with 10 additions and 0 deletions

View File

@ -257,6 +257,12 @@ Screen.prototype.alloc = function() {
}; };
Screen.prototype.render = function() { Screen.prototype.render = function() {
// TODO: Could possibly drop .dirty and just clear the `lines` buffer every
// time before a screen.render. This way clearRegion doesn't have to be
// called in arbitrary places for the sake of clearing a spot where an
// element used to be (e.g. when an element moves or is hidden). There could
// be some overhead though.
// this.screen.clearRegion(0, this.cols, 0, this.rows);
this.children.forEach(function(el) { this.children.forEach(function(el) {
el.render(); el.render();
}); });
@ -494,6 +500,10 @@ function Element(options) {
height: options.height || null height: options.height || null
}; };
// TODO: Possibly add padding/margins?
// this.position.padding = options.padding || 0;
// this.position.margin = options.margin || 0;
this.hidden = options.hidden || false; this.hidden = options.hidden || false;
this.fg = options.fg || 0x1ff; this.fg = options.fg || 0x1ff;
this.bg = options.bg || 0x1ff; this.bg = options.bg || 0x1ff;