Dimension () { int width = myEditor.getGutterComponentEx().getWidth() + myEditor.getScrollingModel().getVisibleArea().width - myEditor.getVerticalScrollBar().getWidth(); width -= JBUIScale.scale(EDITOR_FRAGMENT_POPUP_BORDER) * 2 + myContentInsets; return new Dimension(width - BalloonImpl.POINTER_LENGTH.get(), Math.min(2 * PREVIEW_LINES * myEditor.getLineHeight(), myEditor.visualLineToY(myEndVisualLine) - myEditor.visualLineToY(myStartVisualLine))); }