int clientAreaHeight = getClientArea().height; int bottomIndex = getLineIndex(clientAreaHeight); if (bottomIndex > 0) { int linePixel = getLinePixel(bottomIndex); int lineHeight = lineCache.getLineHeight(bottomIndex); if (linePixel + lineHeight > clientAreaHeight) { bottomIndex--;
int bottomIndex; if (isFixedLineHeight()) { int lineCount = 1; if (lineHeight != 0) {  int partialTopLineHeight = topIndex * lineHeight - verticalScrollOffset; lineCount = (getClientArea().height - partialTopLineHeight) / lineHeight; } bottomIndex = Math.min(content.getLineCount() - 1, topIndex + Math.max(0, lineCount - 1)); } else { int clientAreaHeight = getClientArea().height; bottomIndex = getLineIndex(clientAreaHeight); if (bottomIndex > 0) { int linePixel = getLinePixel(bottomIndex); int lineHeight = lineCache.getLineHeight(bottomIndex); if (linePixel + lineHeight > clientAreaHeight) { bottomIndex--; }
int getBottomIndex() {//	int lineCount = 1;//	if (lineHeight != 0) {//		// calculate the number of lines that are fully visible//		int partialTopLineHeight = topIndex * lineHeight - verticalScrollOffset;//		lineCount = (getClientArea().height - partialTopLineHeight) / lineHeight;//	}//	return Math.min(content.getLineCount() - 1, topIndex + Math.max(0, lineCount - 1));	int clientAreaHeight = getClientArea().height;	int bottomIndex = getLineIndex(clientAreaHeight);	if (bottomIndex > 0) {		int linePixel = getLinePixel(bottomIndex);		int lineHeight = lineCache.getLineHeight(bottomIndex);		if (linePixel + lineHeight > clientAreaHeight) {			bottomIndex--;		}	}	return bottomIndex;}