@@ -254,7 +254,6 void AxisItem::setLayout(QVector<qreal>& layout) | |||
|
254 | 254 | |
|
255 | 255 | Q_ASSERT(labels.size() == ticksList.size()); |
|
256 | 256 | Q_ASSERT(layout.size() == ticksList.size()); |
|
257 | Q_ASSERT(layout.size() == m_ticksCount); | |
|
258 | 257 | |
|
259 | 258 | switch (m_type) |
|
260 | 259 | { |
@@ -271,9 +270,9 void AxisItem::setLayout(QVector<qreal>& layout) | |||
|
271 | 270 | QPointF center = labelItem->boundingRect().center(); |
|
272 | 271 | labelItem->setTransformOriginPoint(center.x(), center.y()); |
|
273 | 272 | labelItem->setPos(layout[i] - center.x(), m_rect.bottom() + label_padding); |
|
274 |
if( |
|
|
275 | QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2)); | |
|
276 |
rectItem->setRect(layout[i],m_rect.top(),layout[i |
|
|
273 | if((i+1)%2 && i>1) { | |
|
274 | QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2-1)); | |
|
275 | rectItem->setRect(layout[i-1],m_rect.top(),layout[i]-layout[i-1],m_rect.height()); | |
|
277 | 276 | } |
|
278 | 277 | lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1)); |
|
279 | 278 | lineItem->setLine(layout[i],m_rect.bottom(),layout[i],m_rect.bottom()+5); |
@@ -294,9 +293,9 void AxisItem::setLayout(QVector<qreal>& layout) | |||
|
294 | 293 | QPointF center = labelItem->boundingRect().center(); |
|
295 | 294 | labelItem->setTransformOriginPoint(center.x(), center.y()); |
|
296 | 295 | labelItem->setPos(m_rect.left() - labelItem->boundingRect().width() - label_padding , layout[i]-center.y()); |
|
297 |
if( |
|
|
298 | QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2)); | |
|
299 |
rectItem->setRect(m_rect.left(),layout[i],m_rect.width(),layout[i]-layout[i |
|
|
296 | if((i+1)%2 && i>1) { | |
|
297 | QGraphicsRectItem *rectItem = static_cast<QGraphicsRectItem*>(shades.at(i/2-1)); | |
|
298 | rectItem->setRect(m_rect.left(),layout[i-1],m_rect.width(),layout[i-1]-layout[i]); | |
|
300 | 299 | } |
|
301 | 300 | lineItem = static_cast<QGraphicsLineItem*>(axis.at(i+1)); |
|
302 | 301 | lineItem->setLine(m_rect.left()-5,layout[i],m_rect.left(),layout[i]); |
General Comments 0
You need to be logged in to leave comments.
Login now