do not round mouse position since lines can have fractional screen coordinates now

This commit is contained in:
nightwing 2013-11-13 03:04:56 +04:00
commit 753dbbece5
2 changed files with 7 additions and 4 deletions

View file

@ -2187,7 +2187,7 @@ var EditSession = function(text, mode) {
while (row <= screenRow) {
rowLength = this.getRowLength(docRow);
if (row + rowLength - 1 >= screenRow || docRow >= maxRow) {
if (row + rowLength > screenRow || docRow >= maxRow) {
break;
} else {
row += rowLength;
@ -2222,9 +2222,10 @@ var EditSession = function(text, mode) {
if (this.$useWrapMode) {
var splits = this.$wrapData[docRow];
if (splits) {
column = splits[screenRow - row];
if(screenRow > row && splits.length) {
docColumn = splits[screenRow - row - 1] || splits[splits.length - 1];
var splitIndex = Math.floor(screenRow - row);
column = splits[splitIndex];
if(splitIndex > 0 && splits.length) {
docColumn = splits[splitIndex - 1] || splits[splits.length - 1];
line = line.substring(docColumn);
}
}