Merge pull request #14186 from xiaofeng11/v3_xf

Fix simulator run time only check screen direction flag, but won't check if size setting need swap
This commit is contained in:
pandamicro 2015-10-20 15:22:30 +08:00
commit 1144327003
1 changed files with 7 additions and 1 deletions

View File

@ -96,7 +96,13 @@ void resetDesignResolution()
cocos2d::Size size = ConfigParser::getInstance()->getInitViewSize();
if (!ConfigParser::getInstance()->isLanscape())
{
std::swap(size.width, size.height);
if (size.width > size.height)
std::swap(size.width, size.height);
}
else
{
if (size.width < size.height)
std::swap(size.width, size.height);
}
Director::getInstance()->getOpenGLView()->setDesignResolutionSize(size.width, size.height, ResolutionPolicy::EXACT_FIT);
}