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>
This commit is contained in:
Tomaz Canabrava 2013-07-02 11:14:11 -03:00
parent 6115dc1f12
commit b07429ff8b

View file

@ -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));
}
}