From 99ad874661ac75b2e4ba265767ccc0bbea5a47d8 2013-11-01 06:32:46 From: Titta Heikkala Date: 2013-11-01 06:32:46 Subject: [PATCH] Fix label visibility for category axis Hide the labels in category axis that would be drawn on top of other labels. Task-number: QTRD-2525 Change-Id: Ic66a6b501821bbb14636229096d86d38301cf8b6 Reviewed-by: Miikka Heikkinen --- diff --git a/src/axis/horizontalaxis.cpp b/src/axis/horizontalaxis.cpp index 06122db..799b67f 100644 --- a/src/axis/horizontalaxis.cpp +++ b/src/axis/horizontalaxis.cpp @@ -148,10 +148,9 @@ void HorizontalAxis::updateGeometry() } } //label overlap detection - compensate one pixel for rounding errors - if ((labelItem->pos().x() < width || forceHide || + if (labelItem->pos().x() < width || forceHide || (labelItem->pos().x() + (widthDiff / 2.0)) < (axisRect.left() - 1.0) || - (labelItem->pos().x() + (widthDiff / 2.0) - 1.0) > axisRect.right()) - && !intervalAxis()) { + (labelItem->pos().x() + (widthDiff / 2.0) - 1.0) > axisRect.right()) { labelItem->setVisible(false); } else { labelItem->setVisible(true); diff --git a/src/axis/verticalaxis.cpp b/src/axis/verticalaxis.cpp index 9cf80b3..cf7c31d 100644 --- a/src/axis/verticalaxis.cpp +++ b/src/axis/verticalaxis.cpp @@ -153,10 +153,9 @@ void VerticalAxis::updateGeometry() } //label overlap detection - compensate one pixel for rounding errors - if ((labelItem->pos().y() + boundingRect.height() > height || forceHide || + if (labelItem->pos().y() + boundingRect.height() > height || forceHide || (labelItem->pos().y() + (heightDiff / 2.0) - 1.0) > axisRect.bottom() || - labelItem->pos().y() + (heightDiff / 2.0) < (axisRect.top() - 1.0)) - && !intervalAxis()) { + labelItem->pos().y() + (heightDiff / 2.0) < (axisRect.top() - 1.0)) { labelItem->setVisible(false); } else {