From f4ccfe30c324365123c50bb56cd4b8166bd1f494 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 5 Feb 2014 19:58:53 +0300 Subject: fix adjusting scale if resolution too low. --- src/render/graphics.cpp | 17 +++++++++++++++-- 1 file 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; -- cgit v1.2.3-70-g09d2