diff options
Diffstat (limited to 'sokol_app.h')
| -rw-r--r-- | sokol_app.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/sokol_app.h b/sokol_app.h index 2e635a52..b695b1c3 100644 --- a/sokol_app.h +++ b/sokol_app.h @@ -5905,18 +5905,18 @@ _SOKOL_PRIVATE bool _sapp_win32_update_dimensions(void) { if (GetClientRect(_sapp.win32.hwnd, &rect)) { _sapp.window_width = (int)((float)(rect.right - rect.left) / _sapp.win32.dpi.window_scale); _sapp.window_height = (int)((float)(rect.bottom - rect.top) / _sapp.win32.dpi.window_scale); - const int fb_width = (int)((float)_sapp.window_width * _sapp.win32.dpi.content_scale); - const int fb_height = (int)((float)_sapp.window_height * _sapp.win32.dpi.content_scale); + int fb_width = (int)((float)_sapp.window_width * _sapp.win32.dpi.content_scale); + int fb_height = (int)((float)_sapp.window_height * _sapp.win32.dpi.content_scale); + /* prevent a framebuffer size of 0 when window is minimized */ + if (0 == fb_width) { + fb_width = 1; + } + if (0 == fb_height) { + fb_height = 1; + } if ((fb_width != _sapp.framebuffer_width) || (fb_height != _sapp.framebuffer_height)) { _sapp.framebuffer_width = fb_width; _sapp.framebuffer_height = fb_height; - /* prevent a framebuffer size of 0 when window is minimized */ - if (_sapp.framebuffer_width == 0) { - _sapp.framebuffer_width = 1; - } - if (_sapp.framebuffer_height == 0) { - _sapp.framebuffer_height = 1; - } return true; } } |