diff --git a/src/render/opengl/SDL_render_gl.c b/src/render/opengl/SDL_render_gl.c index 6b825665b..0430a25eb 100644 --- a/src/render/opengl/SDL_render_gl.c +++ b/src/render/opengl/SDL_render_gl.c @@ -1052,7 +1052,7 @@ GL_UpdateClipRect(SDL_Renderer * renderer) int w, h; SDL_GetRendererOutputSize(renderer, &w, &h); - data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h); } } else { data->glDisable(GL_SCISSOR_TEST); diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c index 18329d798..c66018dee 100644 --- a/src/render/opengles/SDL_render_gles.c +++ b/src/render/opengles/SDL_render_gles.c @@ -721,7 +721,7 @@ GLES_UpdateClipRect(SDL_Renderer * renderer) int w, h; SDL_GetRendererOutputSize(renderer, &w, &h); - data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h); } } else { data->glDisable(GL_SCISSOR_TEST); diff --git a/src/render/opengles2/SDL_render_gles2.c b/src/render/opengles2/SDL_render_gles2.c index b911b66a5..87d7b3df2 100644 --- a/src/render/opengles2/SDL_render_gles2.c +++ b/src/render/opengles2/SDL_render_gles2.c @@ -418,7 +418,7 @@ GLES2_UpdateClipRect(SDL_Renderer * renderer) int w, h; SDL_GetRendererOutputSize(renderer, &w, &h); - data->glScissor(renderer->viewport.x + rect->x, (h - renderer->viewport.y - renderer->viewport.h) + rect->y, rect->w, rect->h); + data->glScissor(renderer->viewport.x + rect->x, h - renderer->viewport.y - rect->y - rect->h, rect->w, rect->h); } } else { data->glDisable(GL_SCISSOR_TEST);