From 2e01b474b0773b52d2bb7e4546d5d508fde2d709 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Mon, 18 Feb 2019 00:25:42 -0500 Subject: [PATCH] Corrected SDL_FillRect --- src/SDL12_compat.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c index ad8787325..c4b6d7bb5 100644 --- a/src/SDL12_compat.c +++ b/src/SDL12_compat.c @@ -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; }