Hi,

Currently, when getBounds is called on RectangularShape, it checks
whether the current rectangle is empty and returns an empty rectangle at
0,0 if it is.

I've just committed a mauve test showing that this is not the expected
behaviour; empty rectangles should not be reset.  This is especially
evident when working with graphics clipping; a mathematically empty
shape may not be empty after it is stroked, and this fixes a few
glitches in the batik testsuite.

I've run through a few standard tests and this doesn't seem to break
anything, and there's no prior mauve test for this; however if that
really is the intended behaviour, please let me know and we can work
through it more carefully.

Thanks,
Francis


2006-12-06  Francis Kung  <[EMAIL PROTECTED]>

        * java/awt/geom/RectangularShape.java
        (getBounds): Remove empty rectangle check.

Index: java/awt/geom/RectangularShape.java
===================================================================
RCS file: /cvsroot/classpath/classpath/java/awt/geom/RectangularShape.java,v
retrieving revision 1.6
diff -u -r1.6 RectangularShape.java
--- java/awt/geom/RectangularShape.java	2 Jul 2005 20:32:29 -0000	1.6
+++ java/awt/geom/RectangularShape.java	6 Dec 2006 18:55:12 -0000
@@ -326,15 +326,12 @@
 
   /**
    * Returns a bounding box for this shape, in integer format. Notice that you
-   * may get a tighter bound with getBounds2D. If the frame is empty, the
-   * box is the default empty box at the origin.
+   * may get a tighter bound with getBounds2D.
    *
    * @return a bounding box
    */
   public Rectangle getBounds()
   {
-    if (isEmpty())
-      return new Rectangle();
     double x = getX();
     double y = getY();
     double maxx = Math.ceil(x + getWidth());

Reply via email to