From 7e3f49e14488a2bc27e41700170b406ce58e57ae Mon Sep 17 00:00:00 2001 From: Sergey Malenkov Date: Thu, 1 Mar 2018 15:42:33 +0300 Subject: [PATCH] do not use stored size that less than minimum size --- .../documentation/DocumentationComponent.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java index bd1c2e8ff4b5..29c704cd3e67 100644 --- a/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java +++ b/platform/lang-impl/src/com/intellij/codeInsight/documentation/DocumentationComponent.java @@ -1,4 +1,4 @@ -// 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-2018 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.documentation; @@ -809,7 +809,13 @@ public class DocumentationComponent extends JPanel implements Disposable, DataPr hintSize = new Dimension(width, height); } else { hintSize = DimensionService.getInstance().getSize(DocumentationManager.NEW_JAVADOC_LOCATION_AND_SIZE, myManager.myProject); - hintSize = hintSize != null ? hintSize : MIN_DEFAULT; + if (hintSize == null) { + hintSize = new Dimension(MIN_DEFAULT); + } + else { + hintSize.width = Math.max(hintSize.width, MIN_DEFAULT.width); + hintSize.height = Math.max(hintSize.height, MIN_DEFAULT.height); + } } Point location = myHint.getLocationOnScreen();