##// END OF EJS Templates
Fix label visibility for category axis...
Titta Heikkala -
r2651:99ad874661ac
parent child
Show More
@@ -148,10 +148,9 void HorizontalAxis::updateGeometry()
148 }
148 }
149 }
149 }
150 //label overlap detection - compensate one pixel for rounding errors
150 //label overlap detection - compensate one pixel for rounding errors
151 if ((labelItem->pos().x() < width || forceHide ||
151 if (labelItem->pos().x() < width || forceHide ||
152 (labelItem->pos().x() + (widthDiff / 2.0)) < (axisRect.left() - 1.0) ||
152 (labelItem->pos().x() + (widthDiff / 2.0)) < (axisRect.left() - 1.0) ||
153 (labelItem->pos().x() + (widthDiff / 2.0) - 1.0) > axisRect.right())
153 (labelItem->pos().x() + (widthDiff / 2.0) - 1.0) > axisRect.right()) {
154 && !intervalAxis()) {
155 labelItem->setVisible(false);
154 labelItem->setVisible(false);
156 } else {
155 } else {
157 labelItem->setVisible(true);
156 labelItem->setVisible(true);
@@ -153,10 +153,9 void VerticalAxis::updateGeometry()
153 }
153 }
154
154
155 //label overlap detection - compensate one pixel for rounding errors
155 //label overlap detection - compensate one pixel for rounding errors
156 if ((labelItem->pos().y() + boundingRect.height() > height || forceHide ||
156 if (labelItem->pos().y() + boundingRect.height() > height || forceHide ||
157 (labelItem->pos().y() + (heightDiff / 2.0) - 1.0) > axisRect.bottom() ||
157 (labelItem->pos().y() + (heightDiff / 2.0) - 1.0) > axisRect.bottom() ||
158 labelItem->pos().y() + (heightDiff / 2.0) < (axisRect.top() - 1.0))
158 labelItem->pos().y() + (heightDiff / 2.0) < (axisRect.top() - 1.0)) {
159 && !intervalAxis()) {
160 labelItem->setVisible(false);
159 labelItem->setVisible(false);
161 }
160 }
162 else {
161 else {
General Comments 0
You need to be logged in to leave comments. Login now