Skip to content

Commit

Permalink
Corrected SDL_FillRect
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Feb 18, 2019
1 parent 5bc74c6 commit 2e01b47
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/SDL12_compat.c
Expand Up @@ -1408,12 +1408,13 @@ SDL_SetClipRect(SDL12_Surface *surface12, const SDL_Rect *rect)
DECLSPEC int SDLCALL
SDL_FillRect(SDL12_Surface *dst, SDL_Rect *dstrect, Uint32 color)
{
const SDL_Rect orig_dstrect = *dstrect;
const int retval = SDL20_FillRect(dst->surface20, &orig_dstrect, color);
const int retval = SDL20_FillRect(dst->surface20, dstrect, color);
if (retval != -1)
{
if (dstrect) /* 1.2 stores the clip intersection in dstrect */
if (dstrect) { /* 1.2 stores the clip intersection in dstrect */
const SDL_Rect orig_dstrect = *dstrect;
SDL20_IntersectRect(&orig_dstrect, &dst->clip_rect, dstrect);
}
}
return retval;
}
Expand Down

0 comments on commit 2e01b47

Please sign in to comment.