diff options
author | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-03-21 15:23:20 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@digia.com> | 2013-03-21 15:23:20 +0200 |
commit | c44a116d4ae8fc3f2f2ddd320e1fd480c026c65b (patch) | |
tree | 342942d2c341e1195e6761e0294692b287731c0d /src | |
parent | 63d90f7e7474988d1eb5518ad284e9f9aa44376e (diff) |
Adjust pie slice bounding rectangle to account for thick pens
Task-number: QTRD-1937
Reviewed-by: Mika Salmela
Diffstat (limited to 'src')
-rw-r--r-- | src/piechart/piesliceitem.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/piechart/piesliceitem.cpp b/src/piechart/piesliceitem.cpp index 6ec66ea2..8d7a5793 100644 --- a/src/piechart/piesliceitem.cpp +++ b/src/piechart/piesliceitem.cpp @@ -192,6 +192,11 @@ void PieSliceItem::updateGeometry() m_boundingRect = m_slicePath.boundingRect().united(m_labelArmPath.boundingRect()).united(m_labelTextRect); else m_boundingRect = m_slicePath.boundingRect(); + + // Inflate bounding rect by 2/3 pen width to make sure it encompasses whole slice also for thick pens + // and miter joins. + int penWidth = (m_data.m_slicePen.width() * 2) / 3; + m_boundingRect = m_boundingRect.adjusted(-penWidth, -penWidth, penWidth, penWidth); } QPointF PieSliceItem::sliceCenter(QPointF point, qreal radius, QPieSlice *slice) |