From b07429ff8b9b026044d5851d44151b57f76d7475 Mon Sep 17 00:00:00 2001 From: Tomaz Canabrava Date: Tue, 2 Jul 2013 11:14:11 -0300 Subject: Added the last 'tick' to the rulers The last tick to the rulers were missing, this was making them to look odd, this make the rulers better looking, but it caused the other-non-ported-yet-to-percent stuff to behave in a not so good way, most visible one is the handlers, gonna update them next. Signed-off-by: Tomaz Canabrava --- qt-ui/diveplanner.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'qt-ui') diff --git a/qt-ui/diveplanner.cpp b/qt-ui/diveplanner.cpp index 7d00d1d63..640192d55 100644 --- a/qt-ui/diveplanner.cpp +++ b/qt-ui/diveplanner.cpp @@ -408,15 +408,19 @@ void Ruler::updateTicks() if (orientation == Qt::Horizontal) { double steps = (max - min) / interval; double stepSize = (m.x2() - m.x1()) / steps; - for (qreal pos = m.x1(); pos < m.x2(); pos += stepSize) { + qreal pos; + for (pos = m.x1(); pos < m.x2(); pos += stepSize) { ticks.push_back(new QGraphicsLineItem(pos, m.y1(), pos, m.y1() + tickSize, this)); } + ticks.push_back(new QGraphicsLineItem(pos, m.y1(), pos, m.y1() + tickSize, this)); } else { double steps = (max - min) / interval; double stepSize = (m.y2() - m.y1()) / steps; - for (qreal pos = m.y1(); pos < m.y2(); pos += stepSize) { + qreal pos; + for (pos = m.y1(); pos < m.y2(); pos += stepSize) { ticks.push_back(new QGraphicsLineItem(m.x1(), pos, m.x1() - tickSize, pos, this)); } + ticks.push_back(new QGraphicsLineItem(m.x1(), pos, m.x1() - tickSize, pos, this)); } } -- cgit v1.2.3-70-g09d2