int () { int minWidth = JBUIScale.scale(300); int maxWidth = getPopupAnchor() != null ? JBUIScale.scale(435) : JBUIScale.scale(MAX_DEFAULT.width); int width = myEditorPane.getPreferredWidth(); Insets insets = getInsets(); return MathUtil.clamp(width, minWidth, maxWidth) + insets.left + insets.right; }