Fix on win32 platform if cpp-tests' windows been minisized, after window restore, content size is wrong. (#15236)

This commit is contained in:
xiaofeng11 2016-04-18 17:15:56 +08:00 committed by minggo
parent 37655ea271
commit 061fc2f287
1 changed files with 19 additions and 7 deletions

View File

@ -616,7 +616,14 @@ Rect GLViewImpl::getScissorRect() const
void GLViewImpl::onGLFWError(int errorID, const char* errorDesc)
{
_glfwError = StringUtils::format("GLFWError #%d Happen, %s", errorID, errorDesc);
if (_mainWindow)
{
_glfwError = StringUtils::format("GLFWError #%d Happen, %s", errorID, errorDesc);
}
else
{
_glfwError.append(StringUtils::format("GLFWError #%d Happen, %s\n", errorID, errorDesc));
}
CCLOGERROR("%s", _glfwError.c_str());
}
@ -813,12 +820,17 @@ void GLViewImpl::onGLFWframebuffersize(GLFWwindow* window, int w, int h)
void GLViewImpl::onGLFWWindowSizeFunCallback(GLFWwindow *window, int width, int height)
{
int frameWidth = width / _frameZoomFactor;
int frameHeight = height / _frameZoomFactor;
setFrameSize(frameWidth, frameHeight);
updateDesignResolutionSize();
Director::getInstance()->setViewport();
if (width && height && _resolutionPolicy != ResolutionPolicy::UNKNOWN)
{
Size baseDesignSize = _designResolutionSize;
ResolutionPolicy baseResolutionPolicy = _resolutionPolicy;
int frameWidth = width / _frameZoomFactor;
int frameHeight = height / _frameZoomFactor;
setFrameSize(frameWidth, frameHeight);
setDesignResolutionSize(baseDesignSize.width, baseDesignSize.height, baseResolutionPolicy);
Director::getInstance()->setViewport();
}
}
void GLViewImpl::onGLFWWindowIconifyCallback(GLFWwindow* window, int iconified)