From bf984cb7f0fdd3397db2dafdd93c163536d92bae Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 12 Mar 2005 15:04:49 +0000 Subject: Fix crash that occured when disabling the GUI scaling code svn-id: r17098 --- gui/newgui.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'gui/newgui.cpp') diff --git a/gui/newgui.cpp b/gui/newgui.cpp index 9b4529616b..74753584b6 100644 --- a/gui/newgui.cpp +++ b/gui/newgui.cpp @@ -77,16 +77,15 @@ void NewGui::updateColors() { void NewGui::updateScaleFactor() { if(!_scaleEnable) { _scaleFactor = 1; - return; + } else { + enum { + kDefaultGUIWidth = 320, + kDefaultGUIHeight = 200 + }; + + _scaleFactor = MIN(_system->getOverlayWidth() / kDefaultGUIWidth, _system->getOverlayHeight() / kDefaultGUIHeight); } - enum { - kDefaultGUIWidth = 320, - kDefaultGUIHeight = 200 - }; - - _scaleFactor = MIN(_system->getOverlayWidth() / kDefaultGUIWidth, _system->getOverlayHeight() / kDefaultGUIHeight); - // Pick the font depending on the scale factor. if (_scaleFactor == 1) _font = FontMan.getFontByUsage(Graphics::FontManager::kGUIFont); -- cgit v1.2.3