##// END OF EJS Templates
Fix the minor axis grid animation...
Miikka Heikkinen -
r2851:0e82bb0d49f5
parent child
Show More
@@ -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 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 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 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 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