mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-02-13 15:23:34 +00:00
Perform full rectangle intersection for empty rects
If we don't do that, we leave the x and y values uninitialized. Fixes https://github.com/libsdl-org/sdl12-compat/issues/365
This commit is contained in:
@@ -51,10 +51,6 @@ bool SDL_HASINTERSECTION(const RECTTYPE *A, const RECTTYPE *B)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) {
|
||||
return false; // Special cases for empty rects
|
||||
}
|
||||
|
||||
// Horizontal intersection
|
||||
Amin = A->x;
|
||||
Amax = Amin + A->w;
|
||||
@@ -107,12 +103,6 @@ bool SDL_INTERSECTRECT(const RECTTYPE *A, const RECTTYPE *B, RECTTYPE *result)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (SDL_RECTEMPTY(A) || SDL_RECTEMPTY(B)) { // Special cases for empty rects
|
||||
result->w = 0;
|
||||
result->h = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Horizontal intersection
|
||||
Amin = A->x;
|
||||
Amax = Amin + A->w;
|
||||
|
||||
Reference in New Issue
Block a user