fix scrollbar arithmetic.

This commit is contained in:
Christopher Jeffrey 2013-07-27 05:49:53 -05:00
parent 69f5993735
commit 8f989eeadd

View File

@ -2838,17 +2838,19 @@ Element.prototype.render = function() {
// Draw the scrollbar.
if (this.scrollbar) {
i = Math.max(this._clines.length + 1,
this._scrollBottom() + (yl - yi) + 1);
i = Math.max(this._clines.length, this._scrollBottom());
}
if (coords.notop || coords.nobot) i = -Infinity;
if (this.scrollbar && (yl - yi) < i) {
i -= yl - yi;
x = xl - 1;
if (this.scrollbar.ignoreBorder && this.border) x++;
y = this.childBase + this.childOffset;
y = y / i;
if (this.alwaysScroll) {
y = this.childBase / (i - (yl - yi));
} else {
y = (this.childBase + this.childOffset) / i;
}
y = yi + ((yl - yi) * y | 0);
if (y >= yl) y = yl - 1;
cell = lines[y] && lines[y][x];
if (cell) {
ch = this.scrollbar.ch || ' ';