mirror of
https://github.com/love2d/love.git
synced 2026-08-20 20:49:54 +02:00
Really fixed setting the scissor and then changing Canvases
This commit is contained in:
@@ -235,13 +235,15 @@ Color OpenGL::getClearColor() const
|
|||||||
|
|
||||||
void OpenGL::setViewport(const OpenGL::Viewport &v)
|
void OpenGL::setViewport(const OpenGL::Viewport &v)
|
||||||
{
|
{
|
||||||
|
Viewport oldViewport = state.viewport;
|
||||||
|
|
||||||
glViewport(v.x, v.y, v.w, v.h);
|
glViewport(v.x, v.y, v.w, v.h);
|
||||||
state.viewport = v;
|
state.viewport = v;
|
||||||
|
|
||||||
// glScissor starts from the lower left, so we compensate when setting the
|
// 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. When the viewport is changed, we need to manually update the
|
||||||
// scissor again.
|
// scissor again.
|
||||||
if (v.h != state.viewport.h)
|
if (v.h != oldViewport.h)
|
||||||
setScissor(state.scissor);
|
setScissor(state.scissor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user