fix regression with horizontal scrolling

This commit is contained in:
nightwing 2011-12-18 19:03:09 +04:00
commit 00bc66fd9a

View file

@ -646,12 +646,14 @@ var VirtualRenderer = function(container, theme) {
var scrollLeft = this.scroller.scrollLeft;
if (scrollLeft > left) {
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
left = 0;
this.scrollToX(left);
}
if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
if (left > this.layerConfig.width)
this.$desiredScrollLeft = left + 2 * this.characterWidth;
if (left > this.layerConfig.width + 2 * this.$padding)
this.$desiredScrollLeft = left;
else
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
}
@ -701,7 +703,7 @@ var VirtualRenderer = function(container, theme) {
};
this.scrollToX = function(scrollLeft) {
if (scrollLeft <= this.$padding + 2 * this.layerConfig.characterWidth)
if (scrollLeft <= this.$padding)
scrollLeft = 0;
this.scroller.scrollLeft = scrollLeft;