This commit is contained in:
Fabian Jakobs 2012-02-03 15:43:07 +01:00
commit 21a07bd793
7 changed files with 63 additions and 34 deletions

View file

@ -12228,7 +12228,9 @@ var VirtualRenderer = function(container, theme) {
this.scrollLeft = 0;
event.addListener(this.scroller, "scroll", function() {
_self.session.setScrollLeft(_self.scroller.scrollLeft);
var scrollLeft = _self.scroller.scrollLeft;
_self.scrollLeft = scrollLeft;
_self.session.setScrollLeft(scrollLeft);
});
this.cursorPos = {
@ -12527,7 +12529,7 @@ var VirtualRenderer = function(container, theme) {
};
this.$renderChanges = function(changes) {
if (!changes || !this.session)
if (!changes || !this.session || !this.container.offsetWidth)
return;
// text, scrolling and resize changes can cause the view port size to change
@ -12540,13 +12542,19 @@ var VirtualRenderer = function(container, theme) {
this.$computeLayerConfig();
// horizontal scrolling
if (changes & this.CHANGE_H_SCROLL)
this.scroller.scrollLeft = this.scrollLeft
if (changes & this.CHANGE_H_SCROLL) {
this.scroller.scrollLeft = this.scrollLeft;
// read the value after writing it since the value might get clipped
var scrollLeft = this.scroller.scrollLeft;
this.scrollLeft = scrollLeft;
this.session.setScrollLeft(scrollLeft);
}
// full
if (changes & this.CHANGE_FULL) {
this.$textLayer.checkForSizeChanges();
// update scrollbar first to not loose scroll position when gutter calls resize
// update scrollbar first to not lose scroll position when gutter calls resize
this.$updateScrollBar();
this.$textLayer.update(this.layerConfig);
if (this.showGutter)
@ -12828,10 +12836,9 @@ var VirtualRenderer = function(container, theme) {
if (scrollLeft <= this.$padding)
scrollLeft = 0;
if (this.scrollLeft !== scrollLeft) {
this.$loop.schedule(this.CHANGE_H_SCROLL);
if (this.scrollLeft !== scrollLeft)
this.scrollLeft = scrollLeft;
}
this.$loop.schedule(this.CHANGE_H_SCROLL);
};
this.scrollBy = function(deltaX, deltaY) {