From bc7cbf11739a774461053a4e63e0899d88b4e564 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 24 Oct 2021 13:31:41 +1100 Subject: [PATCH] [common] fix out by one error in `rectsIntersect` --- common/src/rects.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/common/src/rects.c b/common/src/rects.c index 6c3cdbc4..0376406a 100644 --- a/common/src/rects.c +++ b/common/src/rects.c @@ -203,10 +203,11 @@ void rectsFramebufferToBuffer(FrameDamageRect * rects, int count, inline static bool rectIntersects(const FrameDamageRect * r1, const FrameDamageRect * r2) { - return r1->x < r2->x + r2->width && - r1->x + r1->width > r2->x && - r1->y < r2->y + r2->height && - r1->y + r1->height > r2->y; + return !( + r1->x > r2->x + r2->width || + r2->x > r1->x + r1->width || + r1->y > r2->y + r2->height || + r2->y > r1->y + r1->height); } int rectsMergeOverlapping(FrameDamageRect * rects, int count)