Merge branch 'hidpi_fix' of https://github.com/mshunshin/pyqtgraph into mshunshin-hidpi_fix
This commit is contained in:
commit
82e8194ea4
@ -80,7 +80,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
|
|||||||
def getViewport(self):
|
def getViewport(self):
|
||||||
vp = self.opts['viewport']
|
vp = self.opts['viewport']
|
||||||
if vp is None:
|
if vp is None:
|
||||||
return (0, 0, self.width(), self.height())
|
return (0, 0, self.width() * self.devicePixelRatio(), self.height() * self.devicePixelRatio())
|
||||||
else:
|
else:
|
||||||
return vp
|
return vp
|
||||||
|
|
||||||
@ -99,7 +99,7 @@ class GLViewWidget(QtOpenGL.QGLWidget):
|
|||||||
def projectionMatrix(self, region=None):
|
def projectionMatrix(self, region=None):
|
||||||
# Xw = (Xnd + 1) * width/2 + X
|
# Xw = (Xnd + 1) * width/2 + X
|
||||||
if region is None:
|
if region is None:
|
||||||
region = (0, 0, self.width(), self.height())
|
region = (0, 0, self.width() * self.devicePixelRatio(), self.height() * self.devicePixelRatio())
|
||||||
|
|
||||||
x0, y0, w, h = self.getViewport()
|
x0, y0, w, h = self.getViewport()
|
||||||
dist = self.opts['distance']
|
dist = self.opts['distance']
|
||||||
|
@ -122,7 +122,7 @@ if HAVE_OPENGL:
|
|||||||
if not self.uploaded:
|
if not self.uploaded:
|
||||||
self.uploadTexture()
|
self.uploadTexture()
|
||||||
|
|
||||||
glViewport(0, 0, self.width(), self.height())
|
glViewport(0, 0, self.width() * self.devicePixelRatio(), self.height() * self.devicePixelRatio())
|
||||||
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