Point (LogicalPosition pos) { VisualPosition visible = logicalToVisualPosition(pos); int y = visibleLineNumberToYPosition(visible.line); int lineStartOffset; if (pos.line == 0) { lineStartOffset = 0; } else { if (pos.line >= myDocument.getLineCount()) { lineStartOffset = myDocument.getTextLength(); } else { lineStartOffset = myDocument.getLineStartOffset(pos.line); } } int x = getTabbedTextWidth(lineStartOffset, visible); return new Point(x, y); }