summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2d/rect.scm12
1 files changed, 4 insertions, 8 deletions
diff --git a/2d/rect.scm b/2d/rect.scm
index b4bc3af..2420fa9 100644
--- a/2d/rect.scm
+++ b/2d/rect.scm
@@ -156,14 +156,10 @@ not overlap, a rect of size 0 is returned."
(define (rect-intersects? rect1 rect2)
"Return #t if RECT2 overlaps RECT1."
- (or (and (>= (rect-x rect2) (rect-x rect1))
- (<= (rect-x rect2) (rect-x2 rect1)))
- (and (>= (rect-x2 rect2) (rect-x rect1))
- (<= (rect-x2 rect2) (rect-x2 rect1))))
- (or (and (>= (rect-y rect2) (rect-y rect1))
- (<= (rect-y rect2) (rect-y2 rect1)))
- (and (>= (rect-y2 rect2) (rect-y rect1))
- (<= (rect-y2 rect2) (rect-y2 rect1)))))
+ (and (<= (rect-x rect1) (rect-x2 rect2))
+ (>= (rect-x2 rect1) (rect-x rect2))
+ (<= (rect-y rect1) (rect-y2 rect2))
+ (>= (rect-y2 rect1) (rect-y rect2))))
(define (%rect-contains? rect x y)
(and (>= x (rect-x rect))