aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--examples/quick/scenegraph/openglunderqml/squircle.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/quick/scenegraph/openglunderqml/squircle.cpp b/examples/quick/scenegraph/openglunderqml/squircle.cpp
index 8ceb9c5f9e..91d69c90a4 100644
--- a/examples/quick/scenegraph/openglunderqml/squircle.cpp
+++ b/examples/quick/scenegraph/openglunderqml/squircle.cpp
@@ -129,7 +129,10 @@ void Squircle::paint()
m_program->setAttributeArray(0, GL_FLOAT, values, 2);
m_program->setUniformValue("t", (float) m_thread_t);
- glViewport(0, 0, window()->width(), window()->height());
+ qreal ratio = window()->devicePixelRatio();
+ int w = int(ratio * window()->width());
+ int h = int(ratio * window()->height());
+ glViewport(0, 0, w, h);
glDisable(GL_DEPTH_TEST);