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)