Don't descend into children of invisible flamegraph items.
authorMilian Wolff <mail@milianw.de>
Tue, 9 Feb 2016 20:17:48 +0000 (21:17 +0100)
committerMilian Wolff <mail@milianw.de>
Tue, 9 Feb 2016 20:17:48 +0000 (21:17 +0100)
gui/flamegraph.cpp

index d47a789..8d743a2 100644 (file)
@@ -176,9 +176,11 @@ void layoutItems(FrameGraphicsItem *parent)
         auto frameChild = static_cast<FrameGraphicsItem*>(child);
         const qreal w = maxWidth * double(frameChild->cost()) / parent->cost();
         frameChild->setVisible(w > 1);
-        frameChild->setRect(QRectF(x, y, w, h));
-        layoutItems(frameChild);
-        x += w;
+        if (frameChild->isVisible()) {
+            frameChild->setRect(QRectF(x, y, w, h));
+            layoutItems(frameChild);
+            x += w;
+        }
     }
 }