From fe21c531989e27edacdb80db2e173488f8a68ed5 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Sat, 8 Dec 2018 13:03:32 +0300 Subject: [PATCH] use the same code for determining popup size, when positioning popup wrt editor and other elements --- .../src/com/intellij/ui/popup/AbstractPopup.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java index 4d4dc13fedee..15395fc9967c 100644 --- a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java +++ b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java @@ -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) {