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

java.awt.Polygon.updateBounds(int x,int y) can incorrectly update the bounds.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 1.1.7
    • 1.1, 1.1.5, 1.1.6
    • client-libs
    • b01
    • x86, sparc
    • solaris_2.5.1, windows_95
    • Verified



        Name: rlT66838 Date: 08/18/97


        import java.awt.*;

        public class PolygonError
        {
            public static void main(String[] args) {
                Polygon p = new Polygon();

                p.addPoint( 0,20);
                p.addPoint( 0,25);
                p.addPoint( 5,25);
                p.addPoint( 5,20);
                System.out.println("bounds=" +p.getBoundingBox());
                // bounds width and height correct!

                p.addPoint( 5,0);
                System.out.println("bounds=" +p.getBoundingBox());
                // now height is wrong (should be 25)
            }
        }

        company - (Independent Consultant) , email - ###@###.###
        ======================================================================

              dmendenhsunw David Mendenhall (Inactive)
              rlewis Roger Lewis (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: