From 3be090fd7057f9a0e3354e953fd886b585ee8bb2 Mon Sep 17 00:00:00 2001 From: Richard Moe Gustavsen Date: Thu, 4 Jun 2020 14:58:00 +0200 Subject: Native style: shuffle some lines This change is just a refactoring of lines (no-op). Change-Id: I59c7c2e2b003f8b8c41a247d521eaef2f173ae17 Reviewed-by: Richard Moe Gustavsen --- src/imports/nativestyle/items/qquickstyleitem.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/imports/nativestyle/items/qquickstyleitem.cpp') 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()); -- cgit v1.2.3