Don't create geometries for transparent Rectangle {} elements
authorGunnar Sletta <gunnar.sletta@nokia.com>
Wed, 26 Oct 2011 10:42:25 +0000 (12:42 +0200)
committerQt by Nokia <qt-info@nokia.com>
Mon, 7 Nov 2011 17:58:27 +0000 (18:58 +0100)
Change-Id: If59f7ad7f85849559707cecacc9e2d917e68ab26
Reviewed-by: Aaron Kennedy <aaron.kennedy@nokia.com>
src/declarative/items/qquickrectangle.cpp

index a09202c..c3cbaaa 100644 (file)
@@ -492,7 +492,8 @@ QSGNode *QQuickRectangle::updatePaintNode(QSGNode *oldNode, UpdatePaintNodeData
     Q_UNUSED(data);
     Q_D(QQuickRectangle);
 
-    if (width() <= 0 || height() <= 0) {
+    if (width() <= 0 || height() <= 0
+            || (d->color.alpha() == 0 && (!d->pen || d->pen->width() == 0 || d->pen->color().alpha() == 0))) {
         delete oldNode;
         return 0;
     }