same for the horizontal scrollbar

This commit is contained in:
nightwing 2011-05-23 18:28:50 +05:00 committed by Fabian Jakobs
commit 8fc9dac030

View file

@ -520,6 +520,12 @@ var VirtualRenderer = function(container, theme) {
this.content.style.width = longestLine + "px";
this.content.style.height = minHeight + "px";
// scroller.scrollWidth was smaller than scrollLeft we needed
if (this.$desiredScrollLeft) {
this.scrollToX(this.$desiredScrollLeft);
this.$desiredScrollLeft = 0;
}
// Horizontal scrollbar visibility may have changed, which changes
// the client height of the scroller
if (horizScrollChanged)
@ -620,16 +626,17 @@ var VirtualRenderer = function(container, theme) {
this.scrollToY(top + this.lineHeight - this.$size.scrollerHeight);
}
if (this.scroller.scrollLeft > left) {
var scrollLeft = this.scroller.scrollLeft;
if (scrollLeft > left) {
this.scrollToX(left);
}
if (this.scroller.scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
if (left + this.characterWidth > this.scroller.scrollWidth)
this.$renderChanges(this.CHANGE_SIZE);
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
if (left > this.layerConfig.width)
this.$desiredScrollLeft = left + 2 * this.characterWidth;
else
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
}
},