Skip to content

Commit 4d9d7e6

Browse files
more cleanup
1 parent 8fc5cf8 commit 4d9d7e6

File tree

1 file changed

+3
-4
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom

1 file changed

+3
-4
lines changed

bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3903,10 +3903,9 @@ public int getLinePixel(int lineIndex) {
39033903
height += renderer.getLineHeight(i);
39043904
}
39053905
} else {
3906-
for (int i = topIndex - 1; i >= lineIndex; i--) {
3907-
if (i < 0 || i >= lineCount) {
3908-
continue;
3909-
}
3906+
int lastLineToConsider = Math.min(topIndex - 1, lineCount - 1);
3907+
int firstLineToConsider = Math.max(0, lineIndex);
3908+
for (int i = firstLineToConsider; i <= lastLineToConsider; i++) {
39103909
height -= renderer.getLineHeight(i);
39113910
}
39123911
}

0 commit comments

Comments
 (0)