BorderImage inner rect should have a positive size
authorYann Bodson <yann.bodson@nokia.com>
Thu, 28 Jul 2011 07:44:07 +0000 (17:44 +1000)
committerQt by Nokia <qt-info@nokia.com>
Thu, 28 Jul 2011 08:04:08 +0000 (10:04 +0200)
Task-number: QTBUG-19527
Change-Id: I7cba15cc8ca4679d92f2e456ed95629702ea27a1
Reviewed-on: http://codereview.qt.nokia.com/2322
Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Yann Bodson <yann.bodson@nokia.com>
src/declarative/items/qsgborderimage.cpp

index e7b10cb..e4cb535 100644 (file)
@@ -339,8 +339,8 @@ QSGNode *QSGBorderImage::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData *
     const QSGScaleGrid *border = d->getScaleGrid();
     node->setInnerRect(QRectF(border->left(),
                               border->top(),
-                              d->pix.width() - border->right() - border->left(),
-                              d->pix.height() - border->bottom() - border->top()));
+                              qMax(1, d->pix.width() - border->right() - border->left()),
+                              qMax(1, d->pix.height() - border->bottom() - border->top())));
     node->setRect(QRectF(0, 0, width(), height()));
     node->setFiltering(d->smooth ? QSGTexture::Linear : QSGTexture::Nearest);
     node->setHorzontalTileMode(d->horizontalTileMode);