From 79b3f1e6a823ff5fbf9784adb4db9f991d477ec5 Mon Sep 17 00:00:00 2001 From: scrawl Date: Sun, 8 Nov 2015 18:27:01 +0100 Subject: [PATCH] Small cleanup --- components/myguiplatform/scalinglayer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/components/myguiplatform/scalinglayer.cpp b/components/myguiplatform/scalinglayer.cpp index 7f7cac69b..19ae10841 100644 --- a/components/myguiplatform/scalinglayer.cpp +++ b/components/myguiplatform/scalinglayer.cpp @@ -99,8 +99,9 @@ namespace osgMyGUI { MyGUI::IntSize globalViewSize = MyGUI::RenderManager::getInstance().getViewSize(); MyGUI::IntSize viewSize = globalViewSize; - viewSize.width /= getScaleFactor(); - viewSize.height /= getScaleFactor(); + float scale = getScaleFactor(); + viewSize.width /= scale; + viewSize.height /= scale; float hoffset = (globalViewSize.width - mViewSize.width*getScaleFactor())/2.f / static_cast(globalViewSize.width); float voffset = (globalViewSize.height - mViewSize.height*getScaleFactor())/2.f / static_cast(globalViewSize.height);