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

When sizeof Polygon.points or Polyline.points is odd, no Polygon or Polyline showing up on screen

XMLWordPrintable

      This bug is due to an email from Michael (Michael.Heinrichs@Sun.COM).

      Please see the attached test case for detail.

      For Polygon, the bug is introduced by the for loop in the following function implementation:

          function configShape():Path2D {
              // TODO: Should path be moved to a class variable?
              var path = new Path2D();
              path.moveTo(points[0], points[1]);
              for (i in [2..<sizeof points step 2]) {
                  path.lineTo(points[i], points[i+1]); // here step over the boundary---source of the bug
              }
              path.closePath();
              return path;
          }

            lnerad Ľubomír Nerád (Inactive)
            yicao Yinhe Cao (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:

                Estimated:
                Original Estimate - 2 days
                2d
                Remaining:
                Remaining Estimate - 2 days
                2d
                Logged:
                Time Spent - Not Specified
                Not Specified