Really fixed setting the scissor and then changing Canvases

This commit is contained in:
Alex Szpakowski
2013-12-31 23:37:04 -04:00
parent 9a61ca7393
commit ab1cf7fdc5
+3 -1
View File
@@ -235,13 +235,15 @@ Color OpenGL::getClearColor() const
void OpenGL::setViewport(const OpenGL::Viewport &v)
{
Viewport oldViewport = state.viewport;
glViewport(v.x, v.y, v.w, v.h);
state.viewport = v;
// glScissor starts from the lower left, so we compensate when setting the
// scissor. When the viewport is changed, we need to manually update the
// scissor again.
if (v.h != state.viewport.h)
if (v.h != oldViewport.h)
setScissor(state.scissor);
}