lineXOffset += horizontalScrollOffset;
lineXOffset += (horizontalScrollOffset - leftMargin);
int getOffsetAtX(String line, int lineOffset, int lineXOffset) {	GC gc = new GC(this);	int offset;			lineXOffset += horizontalScrollOffset;	if (isBidi()) {		StyledTextBidi bidi = getStyledTextBidi(line, lineOffset, gc);		offset = bidi.getOffsetAtX(lineXOffset);	}			else {		FontData currentFont = gc.getFont().getFontData()[0];		StyleRange[] styles = null;		StyledTextEvent event = getLineStyleData(lineOffset, line);							if (event != null) {			styles = filterLineStyles(event.styles);		}		int low = -1;		int high = line.length();		while (high - low > 1) {			offset = (high + low) / 2;			// Restrict right/high search boundary only if x is within searched text segment.			// Fixes 1GL4ZVE.						if (lineXOffset < textWidth(line, lineOffset, 0, offset + 1, styles, 0, gc, currentFont)) {				high = offset;						}			else 			if (high == line.length() && high - offset == 1) {				// requested x location is past end of line				high = -1;			}			else {				low = offset;			}		}		offset = high;	}	gc.dispose();		return offset;	}