File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -1087,15 +1087,15 @@ void calculateTopIndex(int delta) {
10871087 lineIndex ++;
10881088 }
10891089 int lineHeight = 0 ;
1090- if (lineIndex >= 0 && lineIndex < lineCount ) {
1090+ if (lineExists ( lineIndex ) ) {
10911091 lineHeight = renderer .getCachedLineHeight (lineIndex );
10921092 }
10931093 if (lineIndex < lineCount && -delta + lineHeight <= clientAreaHeight - topMargin - bottomMargin ) {
10941094 topIndex = lineIndex ;
10951095 topIndexY = -delta ;
10961096 } else {
10971097 topIndex = lineIndex - 1 ;
1098- if (topIndex >= 0 && topIndex < lineCount ) {
1098+ if (lineExists ( topIndex ) ) {
10991099 topIndexY = -renderer .getCachedLineHeight (topIndex );
11001100 }
11011101 topIndexY -= delta ;
@@ -1106,15 +1106,15 @@ void calculateTopIndex(int delta) {
11061106 while (lineIndex > 0 ) {
11071107 int previousLineIndex = lineIndex - 1 ;
11081108 int lineHeight = 0 ;
1109- if (previousLineIndex >= 0 && previousLineIndex < lineCount ) {
1109+ if (lineExists ( previousLineIndex ) ) {
11101110 lineHeight = renderer .getCachedLineHeight (previousLineIndex );
11111111 }
11121112 if (delta + lineHeight > 0 ) break ;
11131113 delta += lineHeight ;
11141114 lineIndex --;
11151115 }
11161116 int lineHeight = 0 ;
1117- if (lineIndex >= 0 && lineIndex < lineCount ) {
1117+ if (lineExists ( lineIndex ) ) {
11181118 lineHeight = renderer .getCachedLineHeight (lineIndex );
11191119 }
11201120 if (lineIndex == 0 || -delta + lineHeight <= clientAreaHeight - topMargin - bottomMargin ) {
You can’t perform that action at this time.
0 commit comments