Emscripten: only update pixel ratio if HiDPI is enabled
This commit is contained in:
parent
e8677a1bd2
commit
613955b4f2
2 changed files with 6 additions and 2 deletions
|
@ -263,7 +263,9 @@ static void Emscripten_SetWindowSize(_THIS, SDL_Window * window)
|
|||
if (window->driverdata) {
|
||||
data = (SDL_WindowData *) window->driverdata;
|
||||
/* update pixel ratio */
|
||||
data->pixel_ratio = emscripten_get_device_pixel_ratio();
|
||||
if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
|
||||
data->pixel_ratio = emscripten_get_device_pixel_ratio();
|
||||
}
|
||||
emscripten_set_canvas_size(window->w * data->pixel_ratio, window->h * data->pixel_ratio);
|
||||
|
||||
/*scale canvas down*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue