Fixed a bug resetting the viewport with a render target.
authorSam Lantinga <slouken@libsdl.org>
Fri, 12 Oct 2012 02:30:03 -0700
changeset 65792390a7403b77
parent 6578 77d70ec131bc
child 6580 a7d6106f1715
Fixed a bug resetting the viewport with a render target.
src/render/SDL_render.c
     1.1 --- a/src/render/SDL_render.c	Fri Oct 12 02:20:10 2012 -0700
     1.2 +++ b/src/render/SDL_render.c	Fri Oct 12 02:30:03 2012 -0700
     1.3 @@ -1057,7 +1057,10 @@
     1.4      } else {
     1.5          renderer->viewport.x = 0;
     1.6          renderer->viewport.y = 0;
     1.7 -        if (renderer->window) {
     1.8 +        if (renderer->target) {
     1.9 +            SDL_QueryTexture(renderer->target, NULL, NULL,
    1.10 +                              &renderer->viewport.w, &renderer->viewport.h);
    1.11 +        } else if (renderer->window) {
    1.12              SDL_GetWindowSize(renderer->window,
    1.13                                &renderer->viewport.w, &renderer->viewport.h);
    1.14          } else {