From 5a85ecd8c4f3fba2b42bca817fac14f729bb47cc Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 4 Aug 2022 14:11:53 +0200 Subject: [PATCH] Convert to device pixels when rendering an offscreen quick view Rendering a texture needs to be done in device pixels, not logical pixels. --- src/scenes/opengl/scene_opengl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/scenes/opengl/scene_opengl.cpp b/src/scenes/opengl/scene_opengl.cpp index 78cb156c65..31429c4c3e 100644 --- a/src/scenes/opengl/scene_opengl.cpp +++ b/src/scenes/opengl/scene_opengl.cpp @@ -128,7 +128,7 @@ void SceneOpenGL::paintOffscreenQuickView(OffscreenQuickView *w) } GLShader *shader = ShaderManager::instance()->pushShader(traits); - const QRect rect = w->geometry(); + const QRectF rect = scaledRect(w->geometry(), renderTargetScale()); QMatrix4x4 mvp(renderTargetProjectionMatrix()); mvp.translate(rect.x(), rect.y()); @@ -141,7 +141,7 @@ void SceneOpenGL::paintOffscreenQuickView(OffscreenQuickView *w) glEnable(GL_BLEND); glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); t->bind(); - t->render(w->geometry()); + t->render(rect.toRect()); t->unbind(); glDisable(GL_BLEND);