mirror of
git://projects.qi-hardware.com/nanomap.git
synced 2024-11-24 03:04:59 +02:00
draw start and end markers only when they are set
This commit is contained in:
parent
e18428cb23
commit
fd81fcf1f0
@ -111,17 +111,24 @@ void MonavLayer::paint(QPainter *painter)
|
||||
}
|
||||
}
|
||||
|
||||
QPoint p = map()->geo2screen(m_routeStart.x(), m_routeStart.y());
|
||||
QPoint p;
|
||||
QPolygon tri;
|
||||
|
||||
if (!m_routeStart.isNull()) {
|
||||
p = map()->geo2screen(m_routeStart.x(), m_routeStart.y());
|
||||
tri << p << p+QPoint(-5, -9) << p+QPoint(5, -9) << p;
|
||||
painter->setBrush(Qt::red);
|
||||
painter->drawPolygon(tri);
|
||||
}
|
||||
|
||||
if (!m_routeEnd.isNull()) {
|
||||
p = map()->geo2screen(m_routeEnd.x(), m_routeEnd.y());
|
||||
tri.clear();
|
||||
tri << p << p+QPoint(-5, -9) << p+QPoint(5, -9) << p;
|
||||
painter->setBrush(Qt::blue);
|
||||
painter->drawPolygon(tri);
|
||||
}
|
||||
}
|
||||
|
||||
void MonavLayer::keyPressed(QKeyEvent *event)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user