Fixed Issue 102, screenToTextCoordinates returning incorrect row when window is scrolled in the Y direction

This commit is contained in:
Eric Allam 2011-02-11 01:38:23 +08:00 committed by Fabian Jakobs
commit e228eda37a

View file

@ -615,7 +615,7 @@ var VirtualRenderer = function(container, theme) {
var col = Math.round((pageX + this.scroller.scrollLeft - canvasPos.left - this.$padding)
/ this.characterWidth);
var row = Math.floor((pageY + this.scrollTop - canvasPos.top)
var row = Math.floor((pageY + this.scrollTop - canvasPos.top - window.pageYOffset)
/ this.lineHeight);
return this.session.screenToDocumentPosition(row, Math.max(col, 0));