Skip to content

Commit 1c19bee

Browse files
committed
Perform full rectangle intersection for empty rects
If we don't do that, we leave the x and y values uninitialized. Fixes libsdl-org/sdl12-compat#365 (cherry picked from commit ffd0ca4)
1 parent 639c7a1 commit 1c19bee

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/video/SDL_rect_impl.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ SDL_bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B)
3131
} else if (!B) {
3232
SDL_InvalidParamError("B");
3333
return SDL_FALSE;
34-
} else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) {
35-
return SDL_FALSE; /* Special cases for empty rects */
3634
}
3735

3836
/* Horizontal intersection */
@@ -79,10 +77,6 @@ SDL_bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *resul
7977
} else if (!result) {
8078
SDL_InvalidParamError("result");
8179
return SDL_FALSE;
82-
} else if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { /* Special cases for empty rects */
83-
result->w = 0;
84-
result->h = 0;
85-
return SDL_FALSE;
8680
}
8781

8882
/* Horizontal intersection */

0 commit comments

Comments
 (0)