Merge pull request #5416 from Cacodemon345/qt-devpixelratio-fix

Hardware Renderer: Make sure to account for devicePixelRatio when setting up the matrix
This commit is contained in:
Miran Grča
2025-03-31 18:54:47 +02:00
committed by GitHub

View File

@@ -145,7 +145,7 @@ HardwareRenderer::paintGL()
QVector<QVector2D> texcoords;
QMatrix4x4 mat;
mat.setToIdentity();
mat.ortho(QRectF(0, 0, (qreal) width(), (qreal) height()));
mat.ortho(QRectF(0, 0, (qreal) width() * (qreal) devicePixelRatioF(), (qreal) height() * (qreal) devicePixelRatioF()));
verts.push_back(QVector2D((float) destination.x(), (float) destination.y()));
verts.push_back(QVector2D((float) destination.x(), (float) destination.y() + (float) destination.height()));
verts.push_back(QVector2D((float) destination.x() + (float) destination.width(), (float) destination.y() + (float) destination.height()));