@@ -65,6 +65,7 void HorizontalAxis::updateGeometry() | |||||
65 | arrowItem->setLine(gridRect.left(), axisRect.top(), gridRect.right(), axisRect.top()); |
|
65 | arrowItem->setLine(gridRect.left(), axisRect.top(), gridRect.right(), axisRect.top()); | |
66 |
|
66 | |||
67 | qreal width = 0; |
|
67 | qreal width = 0; | |
|
68 | const QLatin1String ellipsis("..."); | |||
68 |
|
69 | |||
69 | //title |
|
70 | //title | |
70 | QRectF titleBoundingRect; |
|
71 | QRectF titleBoundingRect; | |
@@ -147,8 +148,9 void HorizontalAxis::updateGeometry() | |||||
147 | labelItem->setPos(leftBound + (delta / 2.0) - center.x(), labelItem->pos().y()); |
|
148 | labelItem->setPos(leftBound + (delta / 2.0) - center.x(), labelItem->pos().y()); | |
148 | } |
|
149 | } | |
149 | } |
|
150 | } | |
|
151 | ||||
150 | //label overlap detection - compensate one pixel for rounding errors |
|
152 | //label overlap detection - compensate one pixel for rounding errors | |
151 | if (labelItem->pos().x() < width || forceHide || |
|
153 | if ((labelItem->pos().x() < width && labelItem->toPlainText() == ellipsis) || forceHide || | |
152 | (labelItem->pos().x() + (widthDiff / 2.0)) < (axisRect.left() - 1.0) || |
|
154 | (labelItem->pos().x() + (widthDiff / 2.0)) < (axisRect.left() - 1.0) || | |
153 | (labelItem->pos().x() + (widthDiff / 2.0) - 1.0) > axisRect.right()) { |
|
155 | (labelItem->pos().x() + (widthDiff / 2.0) - 1.0) > axisRect.right()) { | |
154 | labelItem->setVisible(false); |
|
156 | labelItem->setVisible(false); |
General Comments 0
You need to be logged in to leave comments.
Login now