From 965dacece767acfdb7d9bcbff3073af93a68b41d Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 17 Nov 2013 14:51:18 +0300 Subject: fix drawing outside of allowed area in SDL2 default renderer. --- src/render/sdl2graphics.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/render/sdl2graphics.cpp b/src/render/sdl2graphics.cpp index 76cde005a..ff8da65c9 100644 --- a/src/render/sdl2graphics.cpp +++ b/src/render/sdl2graphics.cpp @@ -126,7 +126,7 @@ bool SDLGraphics::drawImage2(const Image *const image, int srcX, int srcY, return false; const gcn::ClipRectangle &top = mClipStack.top(); - if (!top.height) + if (!top.width || !top.height) return false; const SDL_Rect &bounds = image->mBounds; @@ -161,7 +161,7 @@ void SDLGraphics::drawImagePattern(const Image *const image, return; const gcn::ClipRectangle &top = mClipStack.top(); - if (!top.height) + if (!top.width || !top.height) return; const SDL_Rect &bounds = image->mBounds; @@ -212,7 +212,7 @@ void SDLGraphics::drawRescaledImagePattern(const Image *const image, return; const gcn::ClipRectangle &top = mClipStack.top(); - if (!top.height) + if (!top.width || !top.height) return; Image *const tmpImage = image->SDLgetScaledImage( @@ -264,7 +264,7 @@ void SDLGraphics::calcImagePattern(ImageVertexes* const vert, return; const gcn::ClipRectangle &top = mClipStack.top(); - if (!top.height) + if (!top.width || !top.height) return; const SDL_Rect &bounds = image->mBounds; @@ -341,7 +341,7 @@ void SDLGraphics::calcTileSDL(ImageVertexes *const vert, int x, int y) const return; const gcn::ClipRectangle &top = mClipStack.top(); - if (!top.height) + if (!top.width || !top.height) return; const Image *const image = vert->image; -- cgit v1.2.3-70-g09d2