I've a query with regards the java.awt.geom.Path2D.contains() method. I thought a point is considered to lie inside a Shape if and only if: "it lies completely [b]inside the Shape's boundary[/b]" I have a path2D that tells me that a point it does NOT contain point2D p, but when I determine the path's bounds, the bounds DOES contain the point p. How is this possible?
Path2D.Double path = new Path2D.Double(); path.moveTo( 314000.0, 236500.0 ); path.lineTo( 316500.0, 236500.0 ); path.lineTo( 316500.0, 232000.0 ); Rectangle2D r = path.getBounds2D(); PathIterator pit = r.getPathIterator( null ); double[] coords = new double[6]; while( !pit.isDone() ) { pit.currentSegment( coords ); System.out.println( coords[0] + ", " + coords[1] ); pit.next(); } Point2D.Double p= new Point2D.Double( 314400.0, 234454.0 ); boolean a = r.contains( p); System.out.println( a ); boolean b = path.contains( p); System.out.println( b ); [Message sent by forum member 'deirdre' (deirdre)] http://forums.java.net/jive/thread.jspa?messageID=237130 =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff JAVA2D-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".