mirror of
https://github.com/isledecomp/isle-portable.git
synced 2026-02-02 20:11:15 +00:00
Fix Emscripten rendering after SDL3 window size change (#776)
SDL3 commit 1a27b5b838f added code that overwrites window dimensions with CSS values when external_size is detected. This broke rendering because the window was created with browser dimensions instead of the requested 640x480. Force the correct window size immediately after creation to ensure the renderer initializes with the proper dimensions.
This commit is contained in:
parent
33223d1169
commit
f274f1b212
@ -948,6 +948,12 @@ MxResult IsleApp::SetupWindow()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
window = SDL_CreateWindowWithProperties(props);
|
window = SDL_CreateWindowWithProperties(props);
|
||||||
|
|
||||||
|
#ifdef __EMSCRIPTEN__
|
||||||
|
// Force correct window size since SDL3 may have picked up CSS dimensions
|
||||||
|
SDL_SetWindowSize(window, g_targetWidth, g_targetHeight);
|
||||||
|
#endif
|
||||||
|
|
||||||
SDL_SetPointerProperty(SDL_GetWindowProperties(window), ISLE_PROP_WINDOW_CREATE_VIDEO_PARAM, &m_videoParam);
|
SDL_SetPointerProperty(SDL_GetWindowProperties(window), ISLE_PROP_WINDOW_CREATE_VIDEO_PARAM, &m_videoParam);
|
||||||
|
|
||||||
if (m_exclusiveFullScreen && m_fullScreen) {
|
if (m_exclusiveFullScreen && m_fullScreen) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user