fix click offset bug

This commit is contained in:
Fabian Jakobs 2012-02-03 15:42:59 +01:00
commit 2814203c33

View file

@ -110,7 +110,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 = {
@ -422,9 +424,15 @@ var VirtualRenderer = function(container, theme) {
this.$computeLayerConfig();
// horizontal scrolling
if (changes & this.CHANGE_H_SCROLL)
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();