summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTitta Heikkala <titta.heikkala@digia.com>2013-11-04 14:37:48 +0200
committerTitta Heikkala <titta.heikkala@digia.com>2013-11-04 14:51:34 +0200
commitfa6f046bbc74a196db3a32d3bd89b789b8171592 (patch)
tree6b3530786c9d13a459b120864242af5372875174
parent2d0093c081370f74e41973c56f8e9edd89d45f1b (diff)
Fix pie slice label visibilityrelease-1.3.1
The top and bottom edges are checked more closely so that the label is not hidden too early. Task-number: QTRD-2530 Change-Id: I768b0afead636f4f6fadec596e4f0ce0c7d03cf1 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
-rw-r--r--src/piechart/piesliceitem.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/piechart/piesliceitem.cpp b/src/piechart/piesliceitem.cpp
index b549784f..db19d80c 100644
--- a/src/piechart/piesliceitem.cpp
+++ b/src/piechart/piesliceitem.cpp
@@ -209,7 +209,14 @@ void PieSliceItem::updateGeometry()
// Hide label if it's outside the bounding rect of parent item
QRectF labelRect(m_labelItem->boundingRect());
labelRect.moveTopLeft(m_labelItem->pos());
- if (parentItem()->boundingRect().contains(labelRect))
+ if ((parentItem()->boundingRect().left()
+ < (labelRect.left() + m_labelItem->document()->documentMargin() + 1.0))
+ && (parentItem()->boundingRect().right()
+ > (labelRect.right() - m_labelItem->document()->documentMargin() - 1.0))
+ && (parentItem()->boundingRect().top()
+ < (labelRect.top() + m_labelItem->document()->documentMargin() + 1.0))
+ && (parentItem()->boundingRect().bottom()
+ > (labelRect.bottom() - m_labelItem->document()->documentMargin() - 1.0)))
m_labelItem->show();
else
m_labelItem->hide();