We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8fc5cf8 commit 4d9d7e6Copy full SHA for 4d9d7e6
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/StyledText.java
@@ -3903,10 +3903,9 @@ public int getLinePixel(int lineIndex) {
3903
height += renderer.getLineHeight(i);
3904
}
3905
} else {
3906
- for (int i = topIndex - 1; i >= lineIndex; i--) {
3907
- if (i < 0 || i >= lineCount) {
3908
- continue;
3909
- }
+ int lastLineToConsider = Math.min(topIndex - 1, lineCount - 1);
+ int firstLineToConsider = Math.max(0, lineIndex);
+ for (int i = firstLineToConsider; i <= lastLineToConsider; i++) {
3910
height -= renderer.getLineHeight(i);
3911
3912
0 commit comments