do not set lastPos on render(true). remove old code.
This commit is contained in:
parent
7981f8d749
commit
c805b80209
|
@ -139,6 +139,8 @@ The screen on which every other node renders.
|
|||
(not just full-width ones, elements with uniform cells to their sides).
|
||||
this is known to cause flickering with elements that are not full-width,
|
||||
however, it is more optimal for terminal rendering.
|
||||
- **resizeTimeout** - amount of time (in ms) to redraw the screen after the
|
||||
terminal is resized (default: 300).
|
||||
|
||||
##### Properties:
|
||||
|
||||
|
|
|
@ -2003,7 +2003,6 @@ Box.prototype.render = function(stop) {
|
|||
|
||||
// TODO: Possibly do both shrinkBox and shrink
|
||||
// and use whichever values are higher.
|
||||
// Slower than below, but more foolproof.
|
||||
if (this.options.shrinkBox && this.children.length) {
|
||||
xl = 0, yl = 0;
|
||||
for (i = 0; i < this.children.length; i++) {
|
||||
|
@ -2068,28 +2067,20 @@ Box.prototype.render = function(stop) {
|
|||
}
|
||||
}
|
||||
|
||||
// NOTE: Won't work because parent is rendered first.
|
||||
//if (this.options.shrinkBox && this._lastPos) {
|
||||
// xl = this._lastPos.xl, yl = this._lastPos.yl;
|
||||
//}
|
||||
|
||||
// TODO:
|
||||
// Calculate whether we moved/resized by checking the previous _lastPos.
|
||||
// Maybe clear based on that. Possibly emit events here.
|
||||
ret = this._lastPos = {
|
||||
ret = {
|
||||
xi: xi_,
|
||||
xl: xl,
|
||||
yi: yi_,
|
||||
yl: yl,
|
||||
//mxl: xl,
|
||||
//myl: yl
|
||||
yl: yl
|
||||
};
|
||||
|
||||
//this.parent._lastPos.mxl = Math.max(this.parent._lastPos.mxl, xl);
|
||||
//this.parent._lastPos.myl = Math.max(this.parent._lastPos.myl, yl);
|
||||
|
||||
if (stop) return ret;
|
||||
|
||||
this._lastPos = ret;
|
||||
|
||||
battr = this.border
|
||||
? this.sattr(this.style.border, this.style.border.fg, this.style.border.bg)
|
||||
: 0;
|
||||
|
|
Loading…
Reference in New Issue