-
Bug
-
Resolution: Fixed
-
P3
-
1.1.4, 1.2.0
-
1.2.2
-
sparc
-
solaris_2.5
Name: aaC67449 Date: 12/03/97
Polygon.contains(int,int) works incorrectly for some boundary points. In some case it returns true, in another false.
-------------Example ---------------
import java.awt.*;
public class Test {
public static void main( String argv[] ) {
int x[]={0,0,3,2};
int y[]={0,3,3,2};
Polygon p=new Polygon(x,y,4);
if(p.contains(0,1))
System.out.println("FAILED.Polygon contains point [0,1]");
else
System.out.println("Polygon doesn't contain point [0,1]");
if(p.contains(1,1))
System.out.println("FAILED.Polygon contains point [1,1]");
else
System.out.println("Polygon doesn't contain point [1,1]");
}
}
---------Output from the test---------------------
Polygon doesn't contain point [0,1]
FAILED.Polygon contains point [1,1]
--------------------------------------------------
======================================================================