@@ -144,8 +144,7 void HorizontalAxis::updateGeometry() | |||||
144 | const qreal delta = rightBound - leftBound; |
|
144 | const qreal delta = rightBound - leftBound; | |
145 | // Hide label in case visible part of the category at the grid edge is too narrow |
|
145 | // Hide label in case visible part of the category at the grid edge is too narrow | |
146 | if (delta < boundingRect.width() |
|
146 | if (delta < boundingRect.width() | |
147 | && (leftBound == gridRect.left() || rightBound == gridRect.right()) |
|
147 | && (leftBound == gridRect.left() || rightBound == gridRect.right())) { | |
148 | && !intervalAxis()) { |
|
|||
149 | forceHide = true; |
|
148 | forceHide = true; | |
150 | } else { |
|
149 | } else { | |
151 | labelItem->setPos(leftBound + (delta / 2.0) - center.x(), labelItem->pos().y()); |
|
150 | labelItem->setPos(leftBound + (delta / 2.0) - center.x(), labelItem->pos().y()); | |
@@ -181,6 +180,10 void HorizontalAxis::updateGeometry() | |||||
181 | else |
|
180 | else | |
182 | rightBound = qMin(layout[i + 1], gridRect.right()); |
|
181 | rightBound = qMin(layout[i + 1], gridRect.right()); | |
183 | } |
|
182 | } | |
|
183 | if (leftBound < gridRect.left()) | |||
|
184 | leftBound = gridRect.left(); | |||
|
185 | if (rightBound > gridRect.right()) | |||
|
186 | rightBound = gridRect.right(); | |||
184 | shadeItem->setRect(leftBound, gridRect.top(), rightBound - leftBound, |
|
187 | shadeItem->setRect(leftBound, gridRect.top(), rightBound - leftBound, | |
185 | gridRect.height()); |
|
188 | gridRect.height()); | |
186 | if (shadeItem->rect().width() <= 0.0) |
|
189 | if (shadeItem->rect().width() <= 0.0) |
@@ -146,8 +146,7 void VerticalAxis::updateGeometry() | |||||
146 | const qreal delta = lowerBound - upperBound; |
|
146 | const qreal delta = lowerBound - upperBound; | |
147 | // Hide label in case visible part of the category at the grid edge is too narrow |
|
147 | // Hide label in case visible part of the category at the grid edge is too narrow | |
148 | if (delta < boundingRect.height() |
|
148 | if (delta < boundingRect.height() | |
149 | && (lowerBound == gridRect.bottom() || upperBound == gridRect.top()) |
|
149 | && (lowerBound == gridRect.bottom() || upperBound == gridRect.top())) { | |
150 | && !intervalAxis()) { |
|
|||
151 | forceHide = true; |
|
150 | forceHide = true; | |
152 | } else { |
|
151 | } else { | |
153 | labelItem->setPos(labelItem->pos().x() , lowerBound - (delta / 2.0) - center.y()); |
|
152 | labelItem->setPos(labelItem->pos().x() , lowerBound - (delta / 2.0) - center.y()); | |
@@ -185,6 +184,10 void VerticalAxis::updateGeometry() | |||||
185 | upperBound = qMax(layout[i + 1], gridRect.top()); |
|
184 | upperBound = qMax(layout[i + 1], gridRect.top()); | |
186 |
|
185 | |||
187 | } |
|
186 | } | |
|
187 | if (lowerBound > gridRect.bottom()) | |||
|
188 | lowerBound = gridRect.bottom(); | |||
|
189 | if (upperBound < gridRect.top()) | |||
|
190 | upperBound = gridRect.top(); | |||
188 | shadeItem->setRect(gridRect.left(), upperBound, gridRect.width(), |
|
191 | shadeItem->setRect(gridRect.left(), upperBound, gridRect.width(), | |
189 | lowerBound - upperBound); |
|
192 | lowerBound - upperBound); | |
190 | if (shadeItem->rect().height() <= 0.0) |
|
193 | if (shadeItem->rect().height() <= 0.0) |
General Comments 0
You need to be logged in to leave comments.
Login now