diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-15 13:54:31 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2019-05-16 11:10:42 +0000 |
commit | acc3d31f7069a244c32fca01f8a2873e0798c785 (patch) | |
tree | 65fffdd2bf1bfdd91b45f320e942758d75cc3005 | |
parent | 56fbc277a1acc49d9ead4c89edd250a021ef2a01 (diff) |
Fix assert in QSGBasicInternalImageNode::updateGeometry
Handle that hCells and vCells might be 0 with non-0 innerTarget.
Fixes: QTBUG-73768
Change-Id: Id9dde2368e8cdfe40e5b287b16c0473ad7c12d69
Reviewed-by: Robin Burchell <robin.burchell@crimson.no>
-rw-r--r-- | src/quick/scenegraph/qsgbasicinternalimagenode.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp index c434563c90..d8efda1ecc 100644 --- a/src/quick/scenegraph/qsgbasicinternalimagenode.cpp +++ b/src/quick/scenegraph/qsgbasicinternalimagenode.cpp @@ -258,7 +258,7 @@ QSGGeometry *QSGBasicInternalImageNode::updateGeometry(const QRectF &targetRect, xs[1].tx = innerSourceRect.left(); xs += 2; } - if (innerTargetRect.width() != 0) { + if (innerTargetRect.width() != 0 && hTiles > 0) { xs[0].x = innerTargetRect.left(); xs[0].tx = innerSourceRect.x() + (subSourceRect.left() - floorLeft) * innerSourceRect.width(); ++xs; @@ -299,7 +299,7 @@ QSGGeometry *QSGBasicInternalImageNode::updateGeometry(const QRectF &targetRect, ys[1].ty = innerSourceRect.top(); ys += 2; } - if (innerTargetRect.height() != 0) { + if (innerTargetRect.height() != 0 && vTiles > 0) { ys[0].y = innerTargetRect.top(); ys[0].ty = innerSourceRect.y() + (subSourceRect.top() - floorTop) * innerSourceRect.height(); ++ys; |