void () { SelectionModel selectionModel = myEditor.getSelectionModel(); int selectionStartOffset = selectionModel.getSelectionStart(); int selectionEndOffset = selectionModel.getSelectionEnd(); VisualPosition maxColumnVp = getMaxColumnInsideRange(selectionStartOffset, selectionEndOffset); Point maxColumnsPoint = myEditor.visualPositionToXY(maxColumnVp); Point selectionStart = myEditor.visualPositionToXY(myEditor.offsetToVisualPosition(selectionStartOffset)); Point selectionEnd = myEditor.visualPositionToXY(myEditor.offsetToVisualPosition(selectionEndOffset)); selectionStart = SwingUtilities.convertPoint(myContentComponent, selectionStart, myEditorComponent); selectionEnd = SwingUtilities.convertPoint(myContentComponent, selectionEnd, myEditorComponent); maxColumnsPoint = SwingUtilities.convertPoint(myContentComponent, maxColumnsPoint, myEditorComponent); mySelectionStartY = selectionStart.y; mySelectionEndY = selectionEnd.y; myTextRangeMaxColumnX = maxColumnsPoint.x; }