summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-02-05 19:58:53 +0300
committerAndrei Karas <akaras@inbox.ru>2014-02-05 19:58:53 +0300
commitf4ccfe30c324365123c50bb56cd4b8166bd1f494 (patch)
tree0377b8adde291d10a8399c83ff9cc8b3408e1d0c
parent36ba1eb9fca8ae6c54dc9ef04ead7293cdbee326 (diff)
downloadplus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.tar.gz
plus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.tar.bz2
plus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.tar.xz
plus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.zip
fix adjusting scale if resolution too low.
-rw-r--r--src/render/graphics.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/render/graphics.cpp b/src/render/graphics.cpp
index eff4df562..409626c09 100644
--- a/src/render/graphics.cpp
+++ b/src/render/graphics.cpp
@@ -136,8 +136,21 @@ void Graphics::setScale(int scale)
{
if (!scale)
scale = 1;
- if (mActualWidth / scale < 470 || mActualHeight / scale < 320)
- scale = 1;
+ int scaleW = mActualWidth / scale;
+ int scaleH = mActualHeight / scale;
+ if (scaleW < 470)
+ {
+ scale = mActualWidth / 470;
+ if (scale < 1)
+ scale = 1;
+ scaleH = mActualHeight / scale;
+ }
+ if (scaleH < 320)
+ {
+ scale = mActualHeight / 320;
+ if (scale < 1)
+ scale = 1;
+ }
logger->log("set scale: %d", scale);
mScale = scale;
mWidth = mActualWidth / mScale;