summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-07-02 11:14:11 -0300
committerGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-07-02 11:18:31 -0300
commitb07429ff8b9b026044d5851d44151b57f76d7475 (patch)
tree533c7c07d1d58404e1b39ec9cf0154728e11ce34
parent6115dc1f1299d300d477e32745bbb29bdfe3429d (diff)
downloadsubsurface-b07429ff8b9b026044d5851d44151b57f76d7475.tar.gz
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 <tcanabrava@kde.org>
-rw-r--r--qt-ui/diveplanner.cpp8
1 files changed, 6 insertions, 2 deletions
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));
}
}