1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-11-28 05:34:47 +01:00

Code cleanup

This commit is contained in:
Martin Tůma 2018-09-15 08:40:37 +02:00
parent c89137204e
commit b867ce9a7f

View File

@ -9,6 +9,8 @@
#include "pathitem.h"
#define GEOGRAPHICAL_MILE 1855.3248
PathItem::PathItem(const Path &path, Map *map, QGraphicsItem *parent)
: QGraphicsObject(parent)
{
@ -48,9 +50,9 @@ void PathItem::updatePainterPath(Map *map)
for (int i = 1; i < _path.size(); i++) {
const PathPoint &p1 = _path.at(i-1);
const PathPoint &p2 = _path.at(i);
unsigned n = (p2.distance() - p1.distance()) / 1855.3;
unsigned n = ceil((p2.distance() - p1.distance()) / GEOGRAPHICAL_MILE);
if (n) {
if (n > 1) {
Coordinates c1(p1.coordinates());
Coordinates c2(p2.coordinates());
GreatCircle gc(c1, c2);