Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6412695

RadialGradient throws exception if focus is on perimeter of circle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6
    • 6
    • client-libs
    • None
    • 2d
    • b81
    • generic
    • generic

      The following test case creates a RadialGradient with the focus on the
      perimeter of the circle. It generates an ArrayIndexOutOfBoundsException.

      import java.awt.*;
      import java.awt.image.*;
      import java.awt.MultipleGradientPaint.*;

      public class FocusRadial {
          public static void main(String argv[]) {
              BufferedImage bimg = new BufferedImage(10, 10,
                                                     BufferedImage.TYPE_INT_RGB);
              Graphics2D g2d = bimg.createGraphics();
              g2d.setPaint(new RadialGradientPaint(5, 5, 2, 3, 5,
                                                   new float[] {0f, 1f},
                                                   new Color[] {Color.white,
                                                                Color.black},
                                                   CycleMethod.REPEAT));
              g2d.fillRect(0, 0, 10, 10);
          }
      }

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: