mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Fixed broken track/route handling in some corner cases
This commit is contained in:
parent
1e6925da75
commit
9f0582cbea
@ -14,7 +14,7 @@ public:
|
||||
|
||||
qreal distance() const;
|
||||
|
||||
bool isNull() const {return _dd.isEmpty();}
|
||||
bool isNull() const {return (_dd.count() < 2);}
|
||||
|
||||
private:
|
||||
const QVector<Waypoint> &_data;
|
||||
|
@ -12,7 +12,7 @@ RouteItem::RouteItem(const Route &route, QGraphicsItem *parent)
|
||||
{
|
||||
WaypointItem *wi;
|
||||
|
||||
const QVector<Waypoint> &r = route.route();
|
||||
QVector<Waypoint> r = route.route();
|
||||
Q_ASSERT(r.count() >= 2);
|
||||
|
||||
wi = new WaypointItem(r.at(0));
|
||||
|
@ -20,7 +20,7 @@ public:
|
||||
qreal time() const;
|
||||
QDateTime date() const;
|
||||
|
||||
bool isNull() const {return _dd.isEmpty();}
|
||||
bool isNull() const {return (_dd.count() < 2);}
|
||||
|
||||
private:
|
||||
const QVector<Trackpoint> &_data;
|
||||
|
@ -28,13 +28,13 @@ void TrackItem::updateShape()
|
||||
{
|
||||
QPainterPathStroker s;
|
||||
s.setWidth(TRACK_WIDTH * 1.0/scale());
|
||||
_shape = s.createStroke(_path.simplified());
|
||||
_shape = s.createStroke(_path);
|
||||
}
|
||||
|
||||
TrackItem::TrackItem(const Track &track, QGraphicsItem *parent)
|
||||
: QGraphicsItem(parent)
|
||||
{
|
||||
const QVector<QPointF> &t = track.track();
|
||||
QVector<QPointF> t = track.track();
|
||||
Q_ASSERT(t.count() >= 2);
|
||||
|
||||
const QPointF &p = t.at(0);
|
||||
|
Loading…
Reference in New Issue
Block a user