fix horizontal scroll desynchronization on windows
This commit is contained in:
parent
4b3dd3073e
commit
9f2e504d67
1 changed files with 10 additions and 7 deletions
|
|
@ -421,6 +421,10 @@ var VirtualRenderer = function(container, theme) {
|
|||
)
|
||||
this.$computeLayerConfig();
|
||||
|
||||
// horizontal scrolling
|
||||
if (changes & this.CHANGE_H_SCROLL)
|
||||
this.scroller.scrollLeft = this.scrollLeft
|
||||
|
||||
// full
|
||||
if (changes & this.CHANGE_FULL) {
|
||||
this.$textLayer.update(this.layerConfig);
|
||||
|
|
@ -477,11 +481,6 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
if (changes & this.CHANGE_SIZE)
|
||||
this.$updateScrollBar();
|
||||
|
||||
if (changes & this.CHANGE_H_SCROLL) {
|
||||
//this.content.style.left = -this.scrollLeft + "px";
|
||||
this.scroller.scrollLeft = this.scrollLeft
|
||||
}
|
||||
};
|
||||
|
||||
this.$computeLayerConfig = function() {
|
||||
|
|
@ -495,9 +494,13 @@ var VirtualRenderer = function(container, theme) {
|
|||
var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0;
|
||||
var horizScrollChanged = this.$horizScroll !== horizScroll;
|
||||
this.$horizScroll = horizScroll;
|
||||
if (horizScrollChanged)
|
||||
if (horizScrollChanged) {
|
||||
this.scroller.style.overflowX = horizScroll ? "scroll" : "hidden";
|
||||
|
||||
// when we hide scrollbar scroll event isn't emited
|
||||
// leaving session with wrong scrollLeft value
|
||||
if (!horizScroll)
|
||||
this.session.setScrollLeft(0);
|
||||
}
|
||||
var maxHeight = this.session.getScreenLength() * this.lineHeight;
|
||||
this.session.setScrollTop(Math.max(0, Math.min(this.scrollTop, maxHeight - this.$size.scrollerHeight)));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue