@NotNull
    Rectangle getUpdatedBounds(BalloonImpl balloon, Dimension contentSize, Insets shadowInsets) {
      Dimension layeredPaneSize = balloon.myLayeredPane.getSize();
      Point point = balloon.myTargetPoint;

      Rectangle bounds = balloon.myForcedBounds;
      if (bounds == null) {
        int distance = getDistance(balloon, contentSize);
        Point location = balloon.myShowPointer
                         ? getLocation(layeredPaneSize, point, contentSize, distance)
                         // Now distance is used for pointer enabled balloons only
                         : new Point(point.x - contentSize.width / 2, point.y - contentSize.height / 2);
        if (balloon.myShowPointer && balloon.myPointerShiftedToStart) {
          int offset = JBUI.scale(20);
          if (this == ABOVE || this == BELOW) {
            if (contentSize.width / 2 > offset) {
              location.x = point.x - offset;
            }
          }
          else if (this == AT_LEFT || this == AT_RIGHT) {
            if (contentSize.height / 2 > offset) {
              location.y = point.y - offset;
            }
          }
        }
        bounds = new Rectangle(location.x, location.y, contentSize.width, contentSize.height);

        JBInsets.addTo(bounds, shadowInsets);
        ScreenUtil.moveToFit(bounds, new Rectangle(0, 0, layeredPaneSize.width, layeredPaneSize.height), balloon.myContainerInsets, true);
      }

      return bounds;
    }
@NotNull
    Rectangle getUpdatedBounds(BalloonImpl balloon, Dimension contentSize, Insets shadowInsets)