mirror of https://github.com/axmolengine/axmol.git
Fix on win32 platform if cpp-tests' windows been minisized, after window restore, content size is wrong. (#15236)
This commit is contained in:
parent
37655ea271
commit
061fc2f287
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue