From 846f612fcc4df58d2dd1ba6af41974591cc6dbf3 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Fri, 5 Aug 2022 10:56:13 +0200 Subject: [PATCH] trackmouse: Account for render target scale when rendering --- src/effects/trackmouse/trackmouse.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/effects/trackmouse/trackmouse.cpp b/src/effects/trackmouse/trackmouse.cpp index 7bf83e9025..9045785cb8 100644 --- a/src/effects/trackmouse/trackmouse.cpp +++ b/src/effects/trackmouse/trackmouse.cpp @@ -116,11 +116,11 @@ void TrackMouseEffect::paintScreen(int mask, const QRegion ®ion, ScreenPaintD const float y = p.y(); const auto scale = effects->renderTargetScale(); for (int i = 0; i < 2; ++i) { - matrix.translate(x, y, 0.0); + matrix.translate(x * scale, y * scale, 0.0); matrix.rotate(i ? -2 * m_angle : m_angle, 0, 0, 1.0); - matrix.translate(-x, -y, 0.0); + matrix.translate(-x * scale, -y * scale, 0.0); QMatrix4x4 mvp(matrix); - mvp.translate(m_lastRect[i].x(), m_lastRect[i].y()); + mvp.translate(m_lastRect[i].x() * scale, m_lastRect[i].y() * scale); shader->setUniform(GLShader::ModelViewProjectionMatrix, mvp); m_texture[i]->bind(); m_texture[i]->render(m_lastRect[i], scale);