From 0a06942e4e46783a6a56e7f42bf3e57280fe003a Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 21 Feb 2016 14:41:29 +0100 Subject: GRAPHICS: Skip empty rects and empty shadows in VectorRendererSpec::drawSquareShadow. --- graphics/VectorRendererSpec.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'graphics') diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp index 5e53e61241..b360327c55 100644 --- a/graphics/VectorRendererSpec.cpp +++ b/graphics/VectorRendererSpec.cpp @@ -1865,6 +1865,11 @@ drawCircleAlg(int x1, int y1, int r, PixelType color, VectorRenderer::FillMode f template void VectorRendererSpec:: drawSquareShadow(int x, int y, int w, int h, int offset) { + // Do nothing for empty rects or no shadow offset. + if (w <= 0 || h <= 0 || offset <= 0) { + return; + } + PixelType *ptr = (PixelType *)_activeSurface->getBasePtr(x + w - 1, y + offset); int pitch = _activeSurface->pitch / _activeSurface->format.bytesPerPixel; int i, j; -- cgit v1.2.3