aboutsummaryrefslogtreecommitdiffstats
path: root/src/imports/nativestyle/items/qquickstyleitem.cpp
diff options
context:
space:
mode:
authorRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-06-04 14:58:00 +0200
committerRichard Moe Gustavsen <richard.gustavsen@qt.io>2020-06-04 15:54:18 +0000
commit3be090fd7057f9a0e3354e953fd886b585ee8bb2 (patch)
tree3882b40f28ca3225553ccbfd24434955710f6187 /src/imports/nativestyle/items/qquickstyleitem.cpp
parente23c0978043ed2e03c94be9fb4afec17f530b589 (diff)
Native style: shuffle some lines
This change is just a refactoring of lines (no-op). Change-Id: I59c7c2e2b003f8b8c41a247d521eaef2f173ae17 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
Diffstat (limited to 'src/imports/nativestyle/items/qquickstyleitem.cpp')
-rw-r--r--src/imports/nativestyle/items/qquickstyleitem.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/imports/nativestyle/items/qquickstyleitem.cpp b/src/imports/nativestyle/items/qquickstyleitem.cpp
index eac37bea..be1e9316 100644
--- a/src/imports/nativestyle/items/qquickstyleitem.cpp
+++ b/src/imports/nativestyle/items/qquickstyleitem.cpp
@@ -114,6 +114,7 @@ QSGNode *QQuickStyleItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePa
if (!node)
node = window()->createNinePatchNode();
+ QRectF bounds = boundingRect();
auto texture = window()->createTextureFromImage(m_paintedImage, QQuickWindow::TextureCanUseAtlas);
QSize padding = m_useNinePatchImage ? m_styleItemGeometry.minimumSize / 2 : QSize(0, 0);
if (boundingRect().width() < m_styleItemGeometry.minimumSize.width())
@@ -121,17 +122,16 @@ QSGNode *QQuickStyleItem::updatePaintNode(QSGNode *oldNode, QQuickItem::UpdatePa
if (boundingRect().height() < m_styleItemGeometry.minimumSize.height())
padding.setHeight(0);
- node->setBounds(boundingRect());
-
#ifdef QT_DEBUG
if (m_debugFlags.testFlag(ShowUnscaled)) {
const qreal scale = window()->devicePixelRatio();
const QSizeF ninePatchImageSize = m_paintedImage.rect().size() / scale;
- node->setBounds(QRectF(QPointF(), ninePatchImageSize));
- qqc2Debug() << "Setting paint node size to size of image:" << ninePatchImageSize;
+ bounds = QRectF(QPointF(), ninePatchImageSize);
+ qqc2Debug() << "Setting paint node bounds to size of image:" << bounds;
}
#endif
+ node->setBounds(bounds);
node->setTexture(texture);
node->setDevicePixelRatio(window()->devicePixelRatio());
node->setPadding(padding.width(), padding.height(), padding.width(), padding.height());