mirror of https://github.com/axmolengine/axmol.git
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:
commit
1144327003
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue