##// END OF EJS Templates
Bugfix: floating 0 in axi labels
Michal Klocek -
r779:a05112f857cf
parent child
Show More
@@ -273,12 +273,12 void Axis::setLayout(QVector<qreal> &layout)
273 273 QGraphicsLineItem *lineItem = static_cast<QGraphicsLineItem*>(lines.at(i));
274 274 lineItem->setLine(layout[i], m_rect.top(), layout[i], m_rect.bottom());
275 275 QGraphicsSimpleTextItem *labelItem = static_cast<QGraphicsSimpleTextItem*>(labels.at(i));
276 if (!categories) {
276 if (!categories || i<1) {
277 277 labelItem->setText(ticksList.at(i));
278 278 QPointF center = labelItem->boundingRect().center();
279 279 labelItem->setTransformOriginPoint(center.x(), center.y());
280 280 labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding);
281 } else if(i>0) {
281 } else {
282 282 labelItem->setText(ticksList.at(i));
283 283 QPointF center = labelItem->boundingRect().center();
284 284 labelItem->setTransformOriginPoint(center.x(), center.y());
@@ -305,12 +305,12 void Axis::setLayout(QVector<qreal> &layout)
305 305 lineItem->setLine(m_rect.left() , layout[i], m_rect.right(), layout[i]);
306 306 QGraphicsSimpleTextItem *labelItem = static_cast<QGraphicsSimpleTextItem*>(labels.at(i));
307 307
308 if (!categories) {
308 if (!categories || i<1) {
309 309 labelItem->setText(ticksList.at(i));
310 310 QPointF center = labelItem->boundingRect().center();
311 311 labelItem->setTransformOriginPoint(center.x(), center.y());
312 312 labelItem->setPos(m_rect.left() - labelItem->boundingRect().width() - label_padding , layout[i]-center.y());
313 } else if (i>0) {
313 } else {
314 314 labelItem->setText(ticksList.at(i));
315 315 QPointF center = labelItem->boundingRect().center();
316 316 labelItem->setTransformOriginPoint(center.x(), center.y());
General Comments 0
You need to be logged in to leave comments. Login now