Skip to content

Commit

Permalink
java9 tweak (#888)
Browse files Browse the repository at this point in the history
  • Loading branch information
Jugen committed Jan 2, 2020
1 parent 725f9d0 commit 14f9479
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ int getLineStartPosition(int charIdx) {

int getLineEndPosition(int charIdx) {
TwoLevelNavigator navigator = textLayout().getTwoLevelNavigator();
int currentLineIndex = navigator.offsetToPosition(charIdx, Forward).getMajor();
int minor = (currentLineIndex == getLineCount() - 1) ? 0 : -1;
return navigator.position(currentLineIndex + 1, minor).toOffset();
int currentLineIndex = navigator.offsetToPosition(charIdx, Forward).getMajor() + 1;
int minor = (currentLineIndex == getLineCount()) ? 0 : -1;
return navigator.position(currentLineIndex, minor).toOffset();
}

int getLineOfCharacter(int charIdx) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,8 @@ TwoLevelNavigator getTwoLevelNavigator() {
int getLineCount() {

if ( lineCount > -1 ) return lineCount;


lineCount = 0;
lineMetrics.clear();
double totLines = 0.0, prevMinY = 1.0, prevMaxY = -1.0;
int totCharSoFar = 0;
Expand Down

0 comments on commit 14f9479

Please sign in to comment.