Skip to content

Commit 732f818

Browse files
committed
Use m_viewRect.
1 parent c33ce0d commit 732f818

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

source/platform/renderers/OpenGL/OpenGL.cpp

+5-7
Original file line numberDiff line numberDiff line change
@@ -122,14 +122,12 @@ namespace Gwk
122122
{
123123
Flush();
124124
Gwk::Rect rect = ClipRegion();
125+
125126
// OpenGL's coords are from the bottom left
126-
// so we need to translate them here.
127-
{
128-
GLint view[4];
129-
glGetIntegerv(GL_VIEWPORT, &view[0]);
130-
rect.y = view[3] - (rect.y + rect.h);
131-
}
132-
glScissor(rect.x*Scale(), rect.y*Scale(), rect.w*Scale(), rect.h*Scale());
127+
rect.y = m_viewRect.h - (rect.y + rect.h);
128+
129+
glScissor(rect.x * Scale(), rect.y * Scale(),
130+
rect.w * Scale(), rect.h * Scale());
133131
glEnable(GL_SCISSOR_TEST);
134132
}
135133

0 commit comments

Comments
 (0)