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