Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed bug 2646 - Problems with software renderer when SDL_SetRenderLo…
…gicalSize set

Fixed setting the software renderer clip rectangle when a viewport is set
  • Loading branch information
slouken committed Aug 14, 2017
1 parent f8de064 commit f8e1874
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/render/software/SDL_render_sw.c
Expand Up @@ -371,9 +371,14 @@ SW_UpdateClipRect(SDL_Renderer * renderer)
SDL_Surface *surface = data->surface;
if (surface) {
if (renderer->clipping_enabled) {
SDL_SetClipRect(surface, &renderer->clip_rect);
SDL_Rect clip_rect;
clip_rect = renderer->clip_rect;
clip_rect.x += renderer->viewport.x;
clip_rect.y += renderer->viewport.y;
SDL_IntersectRect(&renderer->viewport, &clip_rect, &clip_rect);
SDL_SetClipRect(surface, &clip_rect);
} else {
SDL_SetClipRect(surface, NULL);
SDL_SetClipRect(surface, &renderer->viewport);
}
}
return 0;
Expand Down

0 comments on commit f8e1874

Please sign in to comment.