__init__.py edited online with Bitbucket
This prevents issue on Window managers that allow resizing Windows to 0 width or height.
@@ -741,6 +741,9 @@ class BaseWindow(with_metaclass(_WindowMetaclass, EventDispatcher)):
Override this event handler with your own to create another
projection, for example in perspective.
"""
+ # XXX avoid GLException by not allowing 0 width or height.
+ width = max(1, width)
+ height = max(1, height)
gl.glViewport(0, 0, width, height)
gl.glMatrixMode(gl.GL_PROJECTION)
gl.glLoadIdentity()
