##// END OF EJS Templates
Fixed a bug with pie slice clip rect
Tero Ahola -
r1297:e9ff71cfa16b
parent child
Show More
@@ -27,6 +27,7
27 #include <qmath.h>
27 #include <qmath.h>
28 #include <QGraphicsSceneEvent>
28 #include <QGraphicsSceneEvent>
29 #include <QTime>
29 #include <QTime>
30 #include <QDebug>
30
31
31 QTCOMMERCIALCHART_BEGIN_NAMESPACE
32 QTCOMMERCIALCHART_BEGIN_NAMESPACE
32
33
@@ -78,12 +79,14 void PieSliceItem::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*op
78 painter->restore();
79 painter->restore();
79
80
80 if (m_data.m_isLabelVisible) {
81 if (m_data.m_isLabelVisible) {
82 painter->save();
81 painter->setClipRect(parentItem()->boundingRect());
83 painter->setClipRect(parentItem()->boundingRect());
82 painter->setPen(m_data.m_labelPen);
84 painter->setPen(m_data.m_labelPen);
83 painter->drawPath(m_labelArmPath);
85 painter->drawPath(m_labelArmPath);
84 // the pen color will affect the font color as well
86 // the pen color will affect the font color as well
85 painter->setFont(m_data.m_labelFont);
87 painter->setFont(m_data.m_labelFont);
86 painter->drawText(m_labelTextRect.bottomLeft(), m_data.m_labelText);
88 painter->drawText(m_labelTextRect.bottomLeft(), m_data.m_labelText);
89 painter->restore();
87 }
90 }
88 }
91 }
89
92
General Comments 0
You need to be logged in to leave comments. Login now