mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 11:45: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;
|
qreal distance() const;
|
||||||
|
|
||||||
bool isNull() const {return _dd.isEmpty();}
|
bool isNull() const {return (_dd.count() < 2);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QVector<Waypoint> &_data;
|
const QVector<Waypoint> &_data;
|
||||||
|
@ -12,7 +12,7 @@ RouteItem::RouteItem(const Route &route, QGraphicsItem *parent)
|
|||||||
{
|
{
|
||||||
WaypointItem *wi;
|
WaypointItem *wi;
|
||||||
|
|
||||||
const QVector<Waypoint> &r = route.route();
|
QVector<Waypoint> r = route.route();
|
||||||
Q_ASSERT(r.count() >= 2);
|
Q_ASSERT(r.count() >= 2);
|
||||||
|
|
||||||
wi = new WaypointItem(r.at(0));
|
wi = new WaypointItem(r.at(0));
|
||||||
|
@ -20,7 +20,7 @@ public:
|
|||||||
qreal time() const;
|
qreal time() const;
|
||||||
QDateTime date() const;
|
QDateTime date() const;
|
||||||
|
|
||||||
bool isNull() const {return _dd.isEmpty();}
|
bool isNull() const {return (_dd.count() < 2);}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QVector<Trackpoint> &_data;
|
const QVector<Trackpoint> &_data;
|
||||||
|
@ -28,13 +28,13 @@ void TrackItem::updateShape()
|
|||||||
{
|
{
|
||||||
QPainterPathStroker s;
|
QPainterPathStroker s;
|
||||||
s.setWidth(TRACK_WIDTH * 1.0/scale());
|
s.setWidth(TRACK_WIDTH * 1.0/scale());
|
||||||
_shape = s.createStroke(_path.simplified());
|
_shape = s.createStroke(_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackItem::TrackItem(const Track &track, QGraphicsItem *parent)
|
TrackItem::TrackItem(const Track &track, QGraphicsItem *parent)
|
||||||
: QGraphicsItem(parent)
|
: QGraphicsItem(parent)
|
||||||
{
|
{
|
||||||
const QVector<QPointF> &t = track.track();
|
QVector<QPointF> t = track.track();
|
||||||
Q_ASSERT(t.count() >= 2);
|
Q_ASSERT(t.count() >= 2);
|
||||||
|
|
||||||
const QPointF &p = t.at(0);
|
const QPointF &p = t.at(0);
|
||||||
|
Loading…
Reference in New Issue
Block a user