Merge pull request #1583 from pijyoi/port_qopenglwidget
RawImageWidget.py : fix port to QOpenGLWidget
This commit is contained in:
commit
acd172eb13
@ -134,6 +134,8 @@ if HAVE_OPENGL:
|
|||||||
glDisable(GL_TEXTURE_2D)
|
glDisable(GL_TEXTURE_2D)
|
||||||
|
|
||||||
def paintGL(self):
|
def paintGL(self):
|
||||||
|
glClear(GL_COLOR_BUFFER_BIT)
|
||||||
|
|
||||||
if self.image is None:
|
if self.image is None:
|
||||||
if self.opts is None:
|
if self.opts is None:
|
||||||
return
|
return
|
||||||
@ -144,9 +146,6 @@ if HAVE_OPENGL:
|
|||||||
if not self.uploaded:
|
if not self.uploaded:
|
||||||
self.uploadTexture()
|
self.uploadTexture()
|
||||||
|
|
||||||
dpr = self.devicePixelRatio()
|
|
||||||
vp = (0, 0, int(self.width() * dpr), int(self.height() * dpr))
|
|
||||||
glViewport(*vp)
|
|
||||||
glEnable(GL_TEXTURE_2D)
|
glEnable(GL_TEXTURE_2D)
|
||||||
glBindTexture(GL_TEXTURE_2D, self.texture)
|
glBindTexture(GL_TEXTURE_2D, self.texture)
|
||||||
glColor4f(1, 1, 1, 1)
|
glColor4f(1, 1, 1, 1)
|
||||||
|
Loading…
Reference in New Issue
Block a user