diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-11-17 14:51:18 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-11-17 14:51:18 +0300 |
commit | 965dacece767acfdb7d9bcbff3073af93a68b41d (patch) | |
tree | 2be79078c83547050fc2bce97cbc256638b12eea /src/render/sdl2graphics.cpp | |
parent | 78f40e3833b69b987678c66685ee9338d71806eb (diff) | |
download | manaverse-965dacece767acfdb7d9bcbff3073af93a68b41d.tar.gz manaverse-965dacece767acfdb7d9bcbff3073af93a68b41d.tar.bz2 manaverse-965dacece767acfdb7d9bcbff3073af93a68b41d.tar.xz manaverse-965dacece767acfdb7d9bcbff3073af93a68b41d.zip |
fix drawing outside of allowed area in SDL2 default renderer.
Diffstat (limited to 'src/render/sdl2graphics.cpp')
-rw-r--r-- | src/render/sdl2graphics.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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; |