private void doPaintThumb(Graphics g, Rectangle thumbBounds) {
    if (thumbBounds.isEmpty() || !scrollbar.isEnabled()) {
      return;
    }

    if (isMacOverlayScrollbar()) {
      paintMacThumb(g, thumbBounds);
    }
    else {
      Rectangle bounds = new Rectangle(thumbBounds);
      if (isThumbTranslucent()) {
        Alignment alignment = Alignment.get(scrollbar);
        if (alignment == Alignment.LEFT || alignment == Alignment.RIGHT) {
          int offset = getThumbOffset(bounds.width);
          if (offset > 0) {
            bounds.width -= offset;
            if (alignment == Alignment.RIGHT) bounds.x += offset;
          }
        }
        else {
          int offset = getThumbOffset(bounds.height);
          if (offset > 0) {
            bounds.height -= offset;
            if (alignment == Alignment.BOTTOM) bounds.y += offset;
          }
        }
      }
      else if (SystemInfo.isMac) {
        boolean vertical = scrollbar == null || Adjustable.VERTICAL == scrollbar.getOrientation();
        bounds.x += vertical ? 1 : 0;
        bounds.y += vertical ? 0 : 1;
        bounds.width -= vertical ? 1 : 0;
        bounds.height -= vertical ? 0 : 1;
      }
      else {
        bounds.x += 1;
        bounds.y += 1;
        bounds.width -= 2;
        bounds.height -= 2;
      }
      if (SystemInfo.isMac) {
        int max = JBUIScale.scale(12);
        if (max < bounds.width && bounds.width < bounds.height) {
          bounds.x += (bounds.width - max) / 2;
          bounds.width = max;
        }
        else if (max < bounds.height && bounds.height < bounds.width) {
          bounds.y += (bounds.height - max) / 2;
          bounds.height = max;
        }
        float value = fixAnimationValue((float)myThumbFadeColorShift / getAnimationColorShift());
        myThumbPainter.paint((Graphics2D)g, bounds.x, bounds.y, bounds.width, bounds.height, value);
      }
      else {
        float value = fixAnimationValue((float)myThumbFadeColorShift / getAnimationColorShift());
        myThumbPainter.paint((Graphics2D)g, bounds.x, bounds.y, bounds.width, bounds.height, value);
      }
    }
  }
private void doPaintThumb(Graphics g, Rectangle thumbBounds)