diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-02-05 19:58:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-02-05 19:58:53 +0300 |
commit | f4ccfe30c324365123c50bb56cd4b8166bd1f494 (patch) | |
tree | 0377b8adde291d10a8399c83ff9cc8b3408e1d0c /src/render/graphics.cpp | |
parent | 36ba1eb9fca8ae6c54dc9ef04ead7293cdbee326 (diff) | |
download | manaplus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.tar.gz manaplus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.tar.bz2 manaplus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.tar.xz manaplus-f4ccfe30c324365123c50bb56cd4b8166bd1f494.zip |
fix adjusting scale if resolution too low.
Diffstat (limited to 'src/render/graphics.cpp')
-rw-r--r-- | src/render/graphics.cpp | 17 |
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; |