aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickborderimage.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2014-10-27 12:55:54 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2014-10-31 09:50:57 +0100
commit87755d0437413cfb875c50e3dfa53030601567c9 (patch)
tree8fe3eed0aed712a945f78ad849395cbe85e60355 /src/quick/items/qquickborderimage.cpp
parentbd3a4ff1d07e1afa5769f0cbf8de89c7bc3b96ea (diff)
BorderImage: Fix white area when size changes after first paint
When e.g. growing the size of the border image in an animation, we would not get updates of the paint nodes when the size was so small that the bounded target rect and source rect did not change (when the size was smaller than the sum of the borders). Since this can happen, we also need to detect when the size changes and update the node for this case. Task-number: QTBUG-42022 Change-Id: I0849d740f363e66a3a4fd6de23fc9d7399ab0779 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick/items/qquickborderimage.cpp')
-rw-r--r--src/quick/items/qquickborderimage.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick/items/qquickborderimage.cpp b/src/quick/items/qquickborderimage.cpp
index 8d8e4b6a02..07b8958664 100644
--- a/src/quick/items/qquickborderimage.cpp
+++ b/src/quick/items/qquickborderimage.cpp
@@ -582,10 +582,16 @@ QSGNode *QQuickBorderImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeDat
qMax<qreal>(0, width() - border->right() - border->left()),
qMax<qreal>(0, height() - border->bottom() - border->top()));
- if (innerSourceRect != d->oldInnerSourceRect || innerTargetRect != d->oldInnerTargetRect)
+ QSizeF newSize(width(), height());
+ if (innerSourceRect != d->oldInnerSourceRect
+ || innerTargetRect != d->oldInnerTargetRect
+ || newSize != d->oldSize) {
updateNode = true;
+ }
+
d->oldInnerSourceRect = innerSourceRect;
d->oldInnerTargetRect = innerTargetRect;
+ d->oldSize = newSize;
}
bool updatePixmap = d->pixmapChanged;