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

Graphics2D.drawPolygon() fails with IllegalPathStateException

    XMLWordPrintable

Details

    • 2d
    • b77
    • generic

    Backports

      Description

        Graphics2D.drawPolygon(int xPoints[], int yPoints[], int nPoints) fails when arrays are empty and the graphics is scaled.
        This caused jck failure, if default graphics transform is not an identity.

        Log:
        Exception in thread "main" java.awt.geom.IllegalPathStateException: missing initial moveto in path definition
        at java.awt.geom.Path2D$Float.needRoom(Path2D.java:280)
        at java.awt.geom.Path2D.closePath(Path2D.java:1771)
        at sun.java2d.pipe.PixelToShapeConverter.makePoly(PixelToShapeConverter.java:111)
        at sun.java2d.pipe.PixelToShapeConverter.drawPolygon(PixelToShapeConverter.java:125)
        at sun.java2d.pipe.ValidatePipe.drawPolygon(ValidatePipe.java:140)
        at sun.java2d.SunGraphics2D.drawPolygon(SunGraphics2D.java:2279)
        Suggested fix:
        http://cr.openjdk.java.net/~serb/8004821/webrev.00/

        Attachments

          Issue Links

            Activity

              People

                serb Sergey Bylokhov
                serb Sergey Bylokhov
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved: