Fixed a bug where abnormal display occurred after scene switching when the window was resized

This commit is contained in:
2025-12-13 16:28:39 +08:00
parent 455bcc8a50
commit e697d6f797

View File

@@ -170,7 +170,7 @@ std::pair<int, int> SceneManager::getWindowDimensions() const {
// 获取窗口尺寸的辅助方法
int w = 0, h = 0;
if (m_window) {
SDL_GetWindowSize(m_window, &w, &h);
SDL_GetRenderLogicalPresentation(m_renderer, &w, &h, nullptr);
}
return {w > 0 ? w : 1600, h > 0 ? h : 900};
}