for(int i = 0; i < count; i++)
for(int i = 0; i < segmentCount; i++)
	public int xToOffset(int line, int x)	{		x -= textArea.getHorizontalOffset();		TokenMarker tokenMarker = getTokenMarker();		/* Use painter's cached info for speed */		TextAreaPainter painter = textArea.getPainter();		FontMetrics fm = painter.getFontMetrics();		Segment currentLine = painter.currentLine;		if(painter.currentLineIndex != line)		{			getLineText(line,currentLine);			painter.currentLineIndex = line;		}		if(tokenMarker == null)		{			int offset = currentLine.offset;			int count = currentLine.count;			char[] array = currentLine.array;			int width = 0;			for(int i = 0; i < count; i++)			{				char c = array[i + offset];				int charWidth;				if(c == '\t')					charWidth = (int)painter.nextTabStop(width,i)						- width;				else					charWidth = fm.charWidth(c);				if(x - charWidth / 2 < width)					return i;				width += charWidth;			}			return count;		}		else			return 0;	}