restore opts['viewport'] after clobbering
This commit is contained in:
parent
dfd5b5dc1b
commit
7a17cda956
@ -550,6 +550,7 @@ class GLViewWidget(QtWidgets.QOpenGLWidget):
|
||||
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, texwidth, texwidth)
|
||||
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, depth_buf)
|
||||
|
||||
viewport_orig = self.opts['viewport']
|
||||
self.opts['viewport'] = (0, 0, w, h) # viewport is the complete image; this ensures that paintGL(region=...)
|
||||
# is interpreted correctly.
|
||||
p2 = 2 * padding
|
||||
@ -572,7 +573,7 @@ class GLViewWidget(QtWidgets.QOpenGLWidget):
|
||||
output[x+padding:x2-padding, y+padding:y2-padding] = data[padding:w2-padding, -(h2-padding):-padding]
|
||||
|
||||
finally:
|
||||
self.opts['viewport'] = None
|
||||
self.opts['viewport'] = viewport_orig
|
||||
glfbo.glBindFramebuffer(glfbo.GL_FRAMEBUFFER, 0)
|
||||
glBindTexture(GL_TEXTURE_2D, 0)
|
||||
if tex is not None:
|
||||
|
Loading…
Reference in New Issue
Block a user