same for the horizontal scrollbar
This commit is contained in:
parent
64a55719b2
commit
8fc9dac030
1 changed files with 14 additions and 7 deletions
|
|
@ -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));
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue