diff options
author | Jüri Valdmann <juri.valdmann@qt.io> | 2018-01-10 17:00:21 +0100 |
---|---|---|
committer | Jüri Valdmann <juri.valdmann@qt.io> | 2018-01-12 09:59:51 +0000 |
commit | ceba0c6b9a0ac3b50f460572ba95bbbedbbaccae (patch) | |
tree | d5a2a80d36461bcda1d1b74d272bd4ed562d4915 /src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp | |
parent | bbf3c4715a1569b26a3aa029046e26989efd6edc (diff) |
QSGSoftwarePixmapRenderer: Fix incorrect background coordinates
The pixmap renderer sets up QPainter's window coordinates system but still
positions the background node in device coordinates. If the window rectangle is
QRect(x, y, w, h) then the background rectangle will be set to QRect(0, 0, w,
h). As the rendering output is clipped to the background rectangle, this means
that the image will be left with transparent bands of x pixels on the right and
y pixels on the bottom.
Task-number: QTBUG-62867
Change-Id: I3b2c18dafda4381b0daa64f849330f51bcc743b2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp')
-rw-r--r-- | src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp index 30088846a6..4cec84646e 100644 --- a/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp +++ b/src/quick/scenegraph/adaptations/software/qsgabstractsoftwarerenderer.cpp @@ -233,11 +233,11 @@ void QSGAbstractSoftwareRenderer::setBackgroundColor(const QColor &color) renderableNode(m_background)->markMaterialDirty(); } -void QSGAbstractSoftwareRenderer::setBackgroundSize(const QSize &size) +void QSGAbstractSoftwareRenderer::setBackgroundRect(const QRect &rect) { - if (m_background->rect().size().toSize() == size) + if (m_background->rect().toRect() == rect) return; - m_background->setRect(0.0f, 0.0f, size.width(), size.height()); + m_background->setRect(rect); renderableNode(m_background)->markGeometryDirty(); // Invalidate the whole scene when the background is resized markDirty(); @@ -248,9 +248,9 @@ QColor QSGAbstractSoftwareRenderer::backgroundColor() return m_background->color(); } -QSize QSGAbstractSoftwareRenderer::backgroundSize() +QRect QSGAbstractSoftwareRenderer::backgroundRect() { - return m_background->rect().size().toSize(); + return m_background->rect().toRect(); } void QSGAbstractSoftwareRenderer::nodeAdded(QSGNode *node) |