if (lineIndex > lineCount) { lineIndex = lineCount; } if (lineIndex < 0) { lineIndex = 0; }
lineIndex = Math.max(0, Math.min(lineCount, lineIndex));
public int getLinePixel(int lineIndex) {	checkWidget();	//FIXME: range checking?	int lineCount = content.getLineCount();	if (lineIndex > lineCount) {		lineIndex = lineCount;	}	if (lineIndex < 0) {		lineIndex = 0;	}	if (isFixedLineHeight()) {		int lineHeight = renderer.getLineHeight();		return lineIndex * lineHeight - getVerticalScrollOffset() + topMargin;	}	if (lineIndex == topIndex) return topIndexY + topMargin;	int height = topIndexY;	if (lineIndex > topIndex) {		for (int i = topIndex; i < lineIndex; i++) {			height += renderer.getLineHeight(i);		}	} else {		for (int i = topIndex - 1; i >= lineIndex; i--) {			height -= renderer.getLineHeight(i);		}	}	return height + topMargin;}