@@ -293,24 +293,19 void HorizontalAxis::updateGeometry() | |||||
293 | int minorTickCount = valueAxis->minorTickCount(); |
|
293 | int minorTickCount = valueAxis->minorTickCount(); | |
294 | if (minorTickCount != 0) { |
|
294 | if (minorTickCount != 0) { | |
295 | qreal minorTickDistance = (layout[i] - layout[i + 1]) / qreal(minorTickCount + 1); |
|
295 | qreal minorTickDistance = (layout[i] - layout[i + 1]) / qreal(minorTickCount + 1); | |
|
296 | if (axis()->isReverse()) | |||
|
297 | minorTickDistance = -minorTickDistance; | |||
296 | for (int j = 0; j < minorTickCount; j++) { |
|
298 | for (int j = 0; j < minorTickCount; j++) { | |
297 | QGraphicsLineItem *minorGridItem = |
|
299 | QGraphicsLineItem *minorGridItem = | |
298 | static_cast<QGraphicsLineItem *>(minorLines.at(i * minorTickCount + j)); |
|
300 | static_cast<QGraphicsLineItem *>(minorLines.at(i * minorTickCount + j)); | |
299 | QGraphicsLineItem *minorArrowItem = |
|
301 | QGraphicsLineItem *minorArrowItem = | |
300 | static_cast<QGraphicsLineItem *>(minorArrows.at(i * minorTickCount + j)); |
|
302 | static_cast<QGraphicsLineItem *>(minorArrows.at(i * minorTickCount + j)); | |
301 | if (i == 0) { |
|
|||
302 | minorGridItem->setLine(gridRect.left() - minorTickDistance * qreal(j + 1), |
|
|||
303 | gridRect.top(), |
|
|||
304 | gridRect.left() - minorTickDistance * qreal(j + 1), |
|
|||
305 | gridRect.bottom()); |
|
|||
306 | } else { |
|
|||
307 |
|
|
303 | minorGridItem->setLine(gridItem->line().p1().x() | |
308 |
|
|
304 | - minorTickDistance * qreal(j + 1), | |
309 |
|
|
305 | gridRect.top(), | |
310 |
|
|
306 | gridItem->line().p1().x() | |
311 |
|
|
307 | - minorTickDistance * qreal(j + 1), | |
312 |
|
|
308 | gridRect.bottom()); | |
313 | } |
|
|||
314 | if (axis()->alignment() == Qt::AlignTop) { |
|
309 | if (axis()->alignment() == Qt::AlignTop) { | |
315 | minorArrowItem->setLine(minorGridItem->line().p1().x(), |
|
310 | minorArrowItem->setLine(minorGridItem->line().p1().x(), | |
316 | axisRect.bottom(), |
|
311 | axisRect.bottom(), |
@@ -309,24 +309,19 void VerticalAxis::updateGeometry() | |||||
309 | int minorTickCount = valueAxis->minorTickCount(); |
|
309 | int minorTickCount = valueAxis->minorTickCount(); | |
310 | if (minorTickCount != 0) { |
|
310 | if (minorTickCount != 0) { | |
311 | qreal minorTickDistance = (layout[i] - layout[i + 1]) / qreal(minorTickCount + 1); |
|
311 | qreal minorTickDistance = (layout[i] - layout[i + 1]) / qreal(minorTickCount + 1); | |
|
312 | if (axis()->isReverse()) | |||
|
313 | minorTickDistance = -minorTickDistance; | |||
312 | for (int j = 0; j < minorTickCount; j++) { |
|
314 | for (int j = 0; j < minorTickCount; j++) { | |
313 | QGraphicsLineItem *minorGridItem = |
|
315 | QGraphicsLineItem *minorGridItem = | |
314 | static_cast<QGraphicsLineItem *>(minorLines.at(i * minorTickCount + j)); |
|
316 | static_cast<QGraphicsLineItem *>(minorLines.at(i * minorTickCount + j)); | |
315 | QGraphicsLineItem *minorArrowItem = |
|
317 | QGraphicsLineItem *minorArrowItem = | |
316 | static_cast<QGraphicsLineItem *>(minorArrows.at(i * minorTickCount + j)); |
|
318 | static_cast<QGraphicsLineItem *>(minorArrows.at(i * minorTickCount + j)); | |
317 | if (i == 0) { |
|
|||
318 | minorGridItem->setLine(gridRect.left(), |
|
|||
319 | gridRect.bottom() - minorTickDistance * qreal(j + 1), |
|
|||
320 | gridRect.right(), |
|
|||
321 | gridRect.bottom() - minorTickDistance * qreal(j + 1)); |
|
|||
322 | } else { |
|
|||
323 |
|
|
319 | minorGridItem->setLine(gridRect.left(), | |
324 |
|
|
320 | gridItem->line().p1().y() | |
325 |
|
|
321 | - minorTickDistance * qreal(j + 1), | |
326 |
|
|
322 | gridRect.right(), | |
327 |
|
|
323 | gridItem->line().p1().y() | |
328 |
|
|
324 | - minorTickDistance * qreal(j + 1)); | |
329 | } |
|
|||
330 | if (axis()->alignment() == Qt::AlignLeft) { |
|
325 | if (axis()->alignment() == Qt::AlignLeft) { | |
331 | minorArrowItem->setLine(gridRect.left() - labelPadding() / 2, |
|
326 | minorArrowItem->setLine(gridRect.left() - labelPadding() / 2, | |
332 | minorGridItem->line().p1().y(), |
|
327 | minorGridItem->line().p1().y(), |
General Comments 0
You need to be logged in to leave comments.
Login now