manually aligning textures to avoid rounding issues

This commit is contained in:
Uwe Rathmann 2021-12-10 13:39:41 +01:00
parent 8ecff64b4a
commit e4ffc3f074

View File

@ -255,10 +255,13 @@ class QskTextureNodePrivate final : public QSGGeometryNodePrivate
const qreal ratio = window->effectiveDevicePixelRatio();
const QRectF scaledRect( rect.x(), rect.y(),
rect.width() / ratio, rect.height() / ratio );
const qreal x = int( rect.x() / ratio ) * ratio;
const qreal y = int( rect.y() / ratio ) * ratio;
const qreal w = rect.width() / ratio;
const qreal h = rect.height() / ratio;
QSGGeometry::updateTexturedRectGeometry( &geometry, scaledRect, r );
QSGGeometry::updateTexturedRectGeometry(
&geometry, QRectF( x, y, w, h ), r );
}
QSGGeometry geometry;