use the same code for determining popup size, when positioning popup wrt editor and other elements

This commit is contained in:
Dmitry Batrak
2018-12-08 13:03:54 +03:00
parent 244c7f0164
commit fe21c53198
@@ -555,13 +555,7 @@ public class AbstractPopup implements JBPopup {
@NotNull
private RelativePoint guessBestPopupLocation(@NotNull Editor editor) {
RelativePoint preferredLocation = JBPopupFactory.getInstance().guessBestPopupLocation(editor);
Dimension targetSize = myDimensionServiceKey == null ? null : DimensionService.getInstance().getSize(myDimensionServiceKey, myProject);
if (targetSize == null) {
targetSize = getSize();
}
if (targetSize == null) {
targetSize = myComponent.getPreferredSize();
}
Dimension targetSize = getSizeForPositioning();
Point preferredPoint = preferredLocation.getScreenPoint();
Point result = getLocationAboveEditorLineIfPopupIsClippedAtTheBottom(preferredPoint, targetSize, editor);
if (myLocateWithinScreen) {