From e9ff71cfa16ba4302816d6e438a9bdf1829b1a0e 2012-05-30 09:07:26 From: Tero Ahola Date: 2012-05-30 09:07:26 Subject: [PATCH] Fixed a bug with pie slice clip rect --- diff --git a/src/piechart/piesliceitem.cpp b/src/piechart/piesliceitem.cpp index 83d7e25..2992172 100644 --- a/src/piechart/piesliceitem.cpp +++ b/src/piechart/piesliceitem.cpp @@ -27,6 +27,7 @@ #include #include #include +#include QTCOMMERCIALCHART_BEGIN_NAMESPACE @@ -78,12 +79,14 @@ void PieSliceItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*op painter->restore(); if (m_data.m_isLabelVisible) { + painter->save(); painter->setClipRect(parentItem()->boundingRect()); painter->setPen(m_data.m_labelPen); painter->drawPath(m_labelArmPath); // the pen color will affect the font color as well painter->setFont(m_data.m_labelFont); painter->drawText(m_labelTextRect.bottomLeft(), m_data.m_labelText); + painter->restore(); } }