fix first row calculation

This commit is contained in:
Fabian Jakobs 2010-11-02 18:28:03 +01:00
commit ce6e512e9c

View file

@ -376,7 +376,7 @@ var VirtualRenderer = function(container, theme) {
var widthChanged = !this.layerConfig ? true : (this.layerConfig.width != longestLine);
var lineCount = Math.ceil(minHeight / this.lineHeight);
var firstRow = Math.round((this.scrollTop - offset) / this.lineHeight);
var firstRow = Math.max(Math.round((this.scrollTop - offset) / this.lineHeight, 0));
var lastRow = Math.min(this.lines.length, firstRow + lineCount) - 1;
var layerConfig = this.layerConfig = {