aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorJohannes Schickel2016-02-21 14:41:29 +0100
committerJohannes Schickel2016-02-21 14:41:29 +0100
commitdf65bad9d23c77e2d2c57c3db8fee53b5470e1ff (patch)
tree74d9a1e1e5940a165db0bc40fdfabde93e8a12c1 /graphics
parent5f61de0e683a34df6fbe66a8264318f2a049ef04 (diff)
downloadscummvm-rg350-df65bad9d23c77e2d2c57c3db8fee53b5470e1ff.tar.gz
scummvm-rg350-df65bad9d23c77e2d2c57c3db8fee53b5470e1ff.tar.bz2
scummvm-rg350-df65bad9d23c77e2d2c57c3db8fee53b5470e1ff.zip
GRAPHICS: Skip empty rects in VectorRendererSpec::drawSquareAlg.
Diffstat (limited to 'graphics')
-rw-r--r--graphics/VectorRendererSpec.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index fda0021201..b9ad82bf1a 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -1244,6 +1244,11 @@ drawBevelTabAlg(int x, int y, int w, int h, int bevel, PixelType top_color, Pixe
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawSquareAlg(int x, int y, int w, int h, PixelType color, VectorRenderer::FillMode fill_m) {
+ // Do not draw anything for empty rects.
+ if (w <= 0 || h <= 0) {
+ return;
+ }
+
PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x, y);
int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel;
int max_h = h;