aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRendererSpec.cpp
diff options
context:
space:
mode:
authorVicent Marti2009-07-16 11:37:36 +0000
committerVicent Marti2009-07-16 11:37:36 +0000
commit40d8209bca78b548e41f5895da7febe61152b92c (patch)
tree6fa0ee41b296692d33b7c0b0cdef7c1a88ce97a2 /graphics/VectorRendererSpec.cpp
parent19e8b39249df45c99bf1a42782664a2a0588c1db (diff)
downloadscummvm-rg350-40d8209bca78b548e41f5895da7febe61152b92c.tar.gz
scummvm-rg350-40d8209bca78b548e41f5895da7febe61152b92c.tar.bz2
scummvm-rg350-40d8209bca78b548e41f5895da7febe61152b92c.zip
Fixed issue with beveled shapes being drawn outside their shapes. Possible regressions.
svn-id: r42529
Diffstat (limited to 'graphics/VectorRendererSpec.cpp')
-rw-r--r--graphics/VectorRendererSpec.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 49dc2c0ef0..f99e20ec26 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -596,12 +596,15 @@ drawSquare(int x, int y, int w, int h) {
template<typename PixelType>
void VectorRendererSpec<PixelType>::
drawRoundedSquare(int x, int y, int r, int w, int h) {
+
+ x++; y++; w--; h--;
+
if (x + w > Base::_activeSurface->w || y + h > Base::_activeSurface->h ||
w <= 0 || h <= 0 || x < 0 || y < 0 || r <= 0)
return;
- if ((r << 1) > w || (r << 1) > h)
- r = MIN(w >> 1, h >> 1);
+ if ((r * 2) > w || (r * 2) > h)
+ r = MIN(w /2, h / 2);
if (Base::_fillMode != kFillDisabled && Base::_shadowOffset
&& x + w + Base::_shadowOffset < Base::_activeSurface->w
@@ -919,10 +922,14 @@ drawBevelSquareAlg(int x, int y, int w, int h, int bevel, PixelType top_color, P
}
int i, j;
+
+#if 0
x = MAX(x - bevel, 0);
y = MAX(y - bevel, 0);
- h += bevel << 1;
- w += bevel << 1;
+
+ w = w + (bevel * 2);
+ h = h + (bevel * 2);
+#endif
PixelType *ptr_left = (PixelType *)_activeSurface->getBasePtr(x, y);