From: Daniel Karbach Date: Mon, 25 Mar 2013 07:09:19 +0000 (+0100) Subject: fixed sdl::OutlineRect for rects with x or y < 0 X-Git-Url: http://git.localhorst.tv/?p=l2e.git;a=commitdiff_plain;h=a0f72bcd94a77cd398ec82bdce8182bdc5b607f6 fixed sdl::OutlineRect for rects with x or y < 0 --- diff --git a/src/sdl/utility.cpp b/src/sdl/utility.cpp index 1dbf502..061d64c 100644 --- a/src/sdl/utility.cpp +++ b/src/sdl/utility.cpp @@ -41,13 +41,20 @@ void OutlineRect(SDL_Surface *dst, SDL_Rect *dstrect, Uint32 color) { destRect.w = dstrect->w; destRect.h = 1; SDL_FillRect(dst, &destRect, color); - destRect.y += dstrect->h - 1; + destRect.x = dstrect->x; + destRect.y = dstrect->y + dstrect->h - 1; + destRect.w = dstrect->w; + destRect.h = 1; SDL_FillRect(dst, &destRect, color); + destRect.x = dstrect->x; destRect.y = dstrect->y; destRect.w = 1; destRect.h = dstrect->h; SDL_FillRect(dst, &destRect, color); - destRect.x += dstrect->w - 1; + destRect.x = dstrect->x + dstrect->w - 1; + destRect.y = dstrect->y; + destRect.w = 1; + destRect.h = dstrect->h; SDL_FillRect(dst, &destRect, color); }