if (line == 0 || (isSingleLine() == false && line > 0)) { int newCaretOffset = getOffsetAtMouseLocation(x, line);
if (line < 0 || (isSingleLine() && line > 0)) { return; } if (isBidi()) { newCaretOffset = getBidiOffsetAtMouseLocation(x, line); } else { newCaretOffset = getOffsetAtMouseLocation(x, line); } if (mouseDoubleClick) {  newCaretOffset = doMouseWordSelect(x, newCaretOffset, line); } newCaretLine = content.getLineAtOffset(newCaretOffset); if (x >= 0 || newCaretLine != content.getLineAtOffset(caretOffset)) {
void doMouseLocationChange(int x, int y, boolean select) {	int line = (y + verticalScrollOffset) / lineHeight;	int lineCount = content.getLineCount();		if (line > lineCount - 1) {		line = lineCount - 1;	}		// allow caret to be placed below first line only if receiver is 	// not in single line mode. fixes 4820.	if (line == 0 || (isSingleLine() == false && line > 0)) {		int newCaretOffset = getOffsetAtMouseLocation(x, line);				if (newCaretOffset != caretOffset) {			caretOffset = newCaretOffset;			caretLine = line;			if (select) {				doMouseSelection();			}			setCaretLocation();		}		if (select == false) {			clearSelection(true);		}	}}