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 bf8417cc815c..cb7d535e2e49 100644 --- a/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java +++ b/platform/platform-impl/src/com/intellij/ui/popup/AbstractPopup.java @@ -1592,20 +1592,18 @@ public class AbstractPopup implements JBPopup { private void setSize(Dimension size, boolean adjustByContent) { if (isBusy()) return; - Dimension toSet = size; + Dimension toSet = new Dimension(size); + if (adjustByContent) toSet.height += getAdComponentHeight(); if (myPopup == null) { myForcedSize = toSet; } else { - if (adjustByContent) { - toSet.height += getAdComponentHeight(); - } updateMaskAndAlpha(setSize(myContent, toSet)); } } private int getAdComponentHeight() { - return myAdComponent != null && myAdComponent.isShowing() ? myAdComponent.getPreferredSize().height + JBUI.scale(1) : 0; + return myAdComponent != null ? myAdComponent.getPreferredSize().height + JBUI.scale(1) : 0; } @Override