src/video/emscripten/SDL_emscriptenvideo.c
changeset 10541 727f7d796b8d
parent 10335 77b7fccaaa01
child 10737 3406a0f8b041
     1.1 --- a/src/video/emscripten/SDL_emscriptenvideo.c	Fri Oct 14 08:56:04 2016 -0700
     1.2 +++ b/src/video/emscripten/SDL_emscriptenvideo.c	Fri Oct 14 17:06:28 2016 +0100
     1.3 @@ -209,7 +209,7 @@
     1.4  
     1.5      emscripten_get_element_css_size(NULL, &css_w, &css_h);
     1.6  
     1.7 -    wdata->external_size = css_w != scaled_w || css_h != scaled_h;
     1.8 +    wdata->external_size = SDL_floor(css_w) != scaled_w || SDL_floor(css_h) != scaled_h;
     1.9  
    1.10      if ((window->flags & SDL_WINDOW_RESIZABLE) && wdata->external_size) {
    1.11          /* external css has resized us */
    1.12 @@ -262,6 +262,8 @@
    1.13  
    1.14      if (window->driverdata) {
    1.15          data = (SDL_WindowData *) window->driverdata;
    1.16 +        /* update pixel ratio */
    1.17 +        data->pixel_ratio = emscripten_get_device_pixel_ratio();
    1.18          emscripten_set_canvas_size(window->w * data->pixel_ratio, window->h * data->pixel_ratio);
    1.19  
    1.20          /*scale canvas down*/