Now the cursor moves when the line is changed after a long line

This commit is contained in:
Akarshit Wal
2015-04-15 22:28:59 +05:30
parent c64b39b2b5
commit 80cae7e65a
@@ -563,11 +563,11 @@ public class JEditTextArea extends JComponent
int width = painter.getFontMetrics().charWidth('w');
if(x < 0) {
newHorizontalOffset = Math.min(0,horizontalOffset - x + width + 5);
newHorizontalOffset = Math.max(0,horizontalOffset - x + width + 5);
} else if(x + width >= painter.getWidth()) {
newHorizontalOffset = horizontalOffset +
(painter.getWidth() - x) - width - 5;
}
}
return setOrigin(newFirstLine,newHorizontalOffset);
}