mirror of https://github.com/axmolengine/axmol.git
Ensure the window size is correct (#1855)
This commit is contained in:
parent
d69f0c0d91
commit
f20be6ab95
|
@ -498,6 +498,13 @@ bool GLViewImpl::initWithRect(std::string_view viewName, const ax::Rect& rect, f
|
|||
return false;
|
||||
}
|
||||
|
||||
int actualWidth, actualHeight;
|
||||
glfwGetWindowSize(_mainWindow, &actualWidth, &actualHeight);
|
||||
if (static_cast<int>(windowSize.width) != actualWidth || static_cast<int>(windowSize.height) != actualHeight)
|
||||
{
|
||||
windowSize.set(static_cast<float>(actualWidth), static_cast<float>(actualHeight));
|
||||
}
|
||||
|
||||
#if defined(AX_USE_METAL)
|
||||
int fbWidth, fbHeight;
|
||||
glfwGetFramebufferSize(_mainWindow, &fbWidth, &fbHeight);
|
||||
|
|
Loading…
Reference in New Issue