From 03510f1847ca4cff02f5a29d9b26b1d1bc5d0a92 Mon Sep 17 00:00:00 2001 From: Dmitry Batrak Date: Thu, 21 Dec 2017 12:11:44 +0300 Subject: [PATCH] IDEA-183876 Parameter hint popup looks strange in some cases --- .../codeInsight/hint/ParameterInfoComponent.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java index 266577a4d04e..e585664696c1 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/hint/ParameterInfoComponent.java @@ -1,6 +1,6 @@ -// Copyright 2000-2017 JetBrains s.r.o. -// Use of this source code is governed by the Apache 2.0 license that can be -// found in the LICENSE file. +/* + * Copyright 2000-2017 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. + */ package com.intellij.codeInsight.hint; @@ -140,9 +140,9 @@ public class ParameterInfoComponent extends JPanel { @Override public Dimension getPreferredSize() { - int size = myPanels.length; + long visibleRows = Stream.of(myPanels).filter(Component::isVisible).count(); final Dimension preferredSize = super.getPreferredSize(); - if (size >= 0 && size <= 20) { + if (visibleRows <= 20) { return preferredSize; } else {