src/video/emscripten/SDL_emscriptenvideo.c
changeset 12574 109c919d61f6
parent 12571 aa455cfe9ff3
child 12576 8d61748ac590
     1.1 --- a/src/video/emscripten/SDL_emscriptenvideo.c	Tue Jan 29 12:14:54 2019 +0000
     1.2 +++ b/src/video/emscripten/SDL_emscriptenvideo.c	Tue Jan 29 12:18:56 2019 +0000
     1.3 @@ -207,7 +207,7 @@
     1.4      scaled_h = SDL_floor(window->h * wdata->pixel_ratio);
     1.5  
     1.6      /* set a fake size to check if there is any CSS sizing the canvas */
     1.7 -    emscripten_set_canvas_size(1, 1);
     1.8 +    emscripten_set_canvas_element_size(NULL, 1, 1);
     1.9      emscripten_get_element_css_size(NULL, &css_w, &css_h);
    1.10  
    1.11      wdata->external_size = SDL_floor(css_w) != 1 || SDL_floor(css_h) != 1;
    1.12 @@ -220,7 +220,7 @@
    1.13          SDL_SendWindowEvent(window, SDL_WINDOWEVENT_RESIZED, css_w, css_h);
    1.14      }
    1.15  
    1.16 -    emscripten_set_canvas_size(scaled_w, scaled_h);
    1.17 +    emscripten_set_canvas_element_size(NULL, scaled_w, scaled_h);
    1.18  
    1.19      /* if the size is not being controlled by css, we need to scale down for hidpi */
    1.20      if (!wdata->external_size) {
    1.21 @@ -270,7 +270,7 @@
    1.22          if (window->flags & SDL_WINDOW_ALLOW_HIGHDPI) {
    1.23              data->pixel_ratio = emscripten_get_device_pixel_ratio();
    1.24          }
    1.25 -        emscripten_set_canvas_size(window->w * data->pixel_ratio, window->h * data->pixel_ratio);
    1.26 +        emscripten_set_canvas_element_size(NULL, window->w * data->pixel_ratio, window->h * data->pixel_ratio);
    1.27  
    1.28          /*scale canvas down*/
    1.29          if (!data->external_size && data->pixel_ratio != 1.0f) {