if (topIndex > 0 && clientAreaHeight > 0) { int bottomPixel = verticalScrollOffset + clientAreaHeight; int fullLineTopPixel = topIndex * verticalIncrement; int fullLineVisibleHeight = bottomPixel - fullLineTopPixel; if (fullLineVisibleHeight < verticalIncrement) { topIndex--;
if (topIndex > 0) { if (clientAreaHeight > 0) { int bottomPixel = verticalScrollOffset + clientAreaHeight; int fullLineTopPixel = topIndex * verticalIncrement; int fullLineVisibleHeight = bottomPixel - fullLineTopPixel;    if (fullLineVisibleHeight < verticalIncrement) { topIndex--; }
void calculateTopIndex() {	int oldTopIndex = topIndex;	int verticalIncrement = getVerticalIncrement();	int clientAreaHeight = getClientArea().height;		if (verticalIncrement == 0) {		return;	}	topIndex = Compatibility.ceil(verticalScrollOffset, verticalIncrement);	// Set top index to partially visible top line if no line is fully 	// visible but at least some of the widget client area is visible.	// Fixes bug 15088.	if (topIndex > 0 && clientAreaHeight > 0) {		int bottomPixel = verticalScrollOffset + clientAreaHeight;		int fullLineTopPixel = topIndex * verticalIncrement;		int fullLineVisibleHeight = bottomPixel - fullLineTopPixel;		if (fullLineVisibleHeight < verticalIncrement) {			topIndex--;		}	}		if (topIndex != oldTopIndex) {		lineCache.calculate(topIndex, getPartialBottomIndex() - topIndex + 1);		setHorizontalScrollBar();	}}