summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--java/awt/Rectangle.java2
2 files changed, 6 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index d51fa494a..54a15de41 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-08-14 Mark Wielaard <mark@klomp.org>
+
+ * java/lang/Rectangle.java (intersects): Check r.width and r.height
+ first.
+
2004-08-13 Tom Tromey <tromey@redhat.com>
* java/nio/CharBuffer.java (put): Fix typo.
diff --git a/java/awt/Rectangle.java b/java/awt/Rectangle.java
index c3340bb8e..5dc54116f 100644
--- a/java/awt/Rectangle.java
+++ b/java/awt/Rectangle.java
@@ -542,7 +542,7 @@ public class Rectangle extends Rectangle2D implements Shape, Serializable
*/
public boolean intersects(Rectangle r)
{
- return width > 0 && height > 0 && r.width > 0 && r.height > 0
+ return r.width > 0 && r.height > 0 && width > 0 && height > 0
&& r.x < x + width && r.x + r.width > x
&& r.y < y + height && r.y + r.height > y;
}