From ae11372614a01b73f40e7c9b8abd82259ad2cf1f Mon Sep 17 00:00:00 2001 From: Scott Talbert Date: Sat, 25 Jan 2020 12:46:23 -0500 Subject: [PATCH] Fix GLCanvas demo when using HiDPI display OpenGL operates using physical pixels, so we need to factor in the scale factor when setting the GL viewport. --- demo/GLCanvas.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/demo/GLCanvas.py b/demo/GLCanvas.py index 87a217a6..7ea4d9e1 100644 --- a/demo/GLCanvas.py +++ b/demo/GLCanvas.py @@ -102,7 +102,7 @@ class MyCanvasBase(glcanvas.GLCanvas): def DoSetViewport(self): - size = self.size = self.GetClientSize() + size = self.size = self.GetClientSize() * self.GetContentScaleFactor() self.SetCurrent(self.context) glViewport(0, 0, size.width, size.height)