Don't try to show balloon pointer if it too far from balloon bounds.
authorVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Thu, 23 Jul 2015 19:03:20 +0000 (22:03 +0300)
committerVassiliy.Kudryashov <Vassiliy.Kudryashov@jetbrains.com>
Thu, 23 Jul 2015 19:03:20 +0000 (22:03 +0300)
platform/platform-impl/src/com/intellij/ui/BalloonImpl.java

index 359c219fc72bd1d96dcb00f886f05436621a83b8..f98367a833c830faa3321728e51e0d4a54462592 100644 (file)
@@ -53,10 +53,7 @@ import javax.swing.border.EmptyBorder;
 import javax.swing.event.HyperlinkEvent;
 import java.awt.*;
 import java.awt.event.*;
-import java.awt.geom.Area;
-import java.awt.geom.GeneralPath;
-import java.awt.geom.Rectangle2D;
-import java.awt.geom.RoundRectangle2D;
+import java.awt.geom.*;
 import java.awt.image.*;
 import java.util.List;
 import java.util.Set;
@@ -1008,8 +1005,8 @@ public class BalloonImpl implements Balloon, IdeTooltip.Ui {
 
       Rectangle pointless = getPointlessContentRec(bounds, pointerLength);
 
-      int size = getDistanceToTarget(pointless, targetPoint);
-      if (size < pointerLength - 1) return false;
+      int distance = getDistanceToTarget(pointless, targetPoint);
+      if (distance < pointerLength - 1 || distance > 2 * pointerLength) return false;
 
       UnfairTextRange balloonRange;
       UnfairTextRange pointerRange;