aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2010-10-13 20:05:21 +0000
committerTorbjörn Andersson2010-10-13 20:05:21 +0000
commite52b77dc7b87b8511c8760cf76e8fe057e83302f (patch)
tree010112c900e3aa2602779c78ae38573b2c95926f
parentbc2781fdb39b5c7db7154c8dd90538974907508d (diff)
downloadscummvm-rg350-e52b77dc7b87b8511c8760cf76e8fe057e83302f.tar.gz
scummvm-rg350-e52b77dc7b87b8511c8760cf76e8fe057e83302f.tar.bz2
scummvm-rg350-e52b77dc7b87b8511c8760cf76e8fe057e83302f.zip
SWORD25: Worked around crash in options dialog.
I don't really know if this is correct, but aesthetically it goes well with how the scale factor is treated. svn-id: r53447
-rw-r--r--engines/sword25/gfx/bitmap.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/sword25/gfx/bitmap.cpp b/engines/sword25/gfx/bitmap.cpp
index 3a6ffb4a98..db48b2d6fa 100644
--- a/engines/sword25/gfx/bitmap.cpp
+++ b/engines/sword25/gfx/bitmap.cpp
@@ -134,6 +134,8 @@ void Bitmap::setScaleFactorX(float scaleFactorX) {
_width = static_cast<int>(_originalWidth * _scaleFactorX);
if (_scaleFactorX <= 0.0f)
_scaleFactorX = 0.001f;
+ if (_width <= 0)
+ _width = 1;
forceRefresh();
}
}
@@ -156,6 +158,8 @@ void Bitmap::setScaleFactorY(float scaleFactorY) {
_height = static_cast<int>(_originalHeight * scaleFactorY);
if (_scaleFactorY <= 0.0f)
_scaleFactorY = 0.001f;
+ if (_height <= 0)
+ _height = 1;
forceRefresh();
}
}