1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2025-04-21 12:49:10 +02:00

Compare commits

..

No commits in common. "b64065e076bc8ee712dc6ff1420a4d71bab0a68c" and "4a0b7ec83eddb169adbf9bd2f54907210f1a50c7" have entirely different histories.

6 changed files with 23 additions and 23 deletions

View File

@ -712,7 +712,7 @@
<location filename="../src/GUI/gui.cpp" line="907"/> <location filename="../src/GUI/gui.cpp" line="907"/>
<location filename="../src/GUI/gui.cpp" line="925"/> <location filename="../src/GUI/gui.cpp" line="925"/>
<source>CRS directory:</source> <source>CRS directory:</source>
<translation>CRS könyvtár:</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="913"/> <location filename="../src/GUI/gui.cpp" line="913"/>

View File

@ -962,7 +962,7 @@
<location filename="../src/GUI/gui.cpp" line="907"/> <location filename="../src/GUI/gui.cpp" line="907"/>
<location filename="../src/GUI/gui.cpp" line="925"/> <location filename="../src/GUI/gui.cpp" line="925"/>
<source>CRS directory:</source> <source>CRS directory:</source>
<translation>CRS-mapp:</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="915"/> <location filename="../src/GUI/gui.cpp" line="915"/>

View File

@ -712,7 +712,7 @@
<location filename="../src/GUI/gui.cpp" line="907"/> <location filename="../src/GUI/gui.cpp" line="907"/>
<location filename="../src/GUI/gui.cpp" line="925"/> <location filename="../src/GUI/gui.cpp" line="925"/>
<source>CRS directory:</source> <source>CRS directory:</source>
<translation>CRS dizini:</translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../src/GUI/gui.cpp" line="913"/> <location filename="../src/GUI/gui.cpp" line="913"/>

View File

@ -866,7 +866,7 @@
<location filename="../src/GUI/gui.cpp" line="907"/> <location filename="../src/GUI/gui.cpp" line="907"/>
<location filename="../src/GUI/gui.cpp" line="925"/> <location filename="../src/GUI/gui.cpp" line="925"/>
<source>CRS directory:</source> <source>CRS directory:</source>
<translation>CRS </translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<source>GCS/PCS directory:</source> <source>GCS/PCS directory:</source>

View File

@ -41,9 +41,11 @@ static double distance(const Coordinates &c1, const Coordinates &c2)
return hypot(c1.lon() - c2.lon(), c1.lat() - c2.lat()); return hypot(c1.lon() - c2.lon(), c1.lat() - c2.lat());
} }
static bool isClosed(const QVector<Coordinates> &poly) static bool isClosed(const Polygon &poly)
{ {
return (distance(poly.first(), poly.last()) < 0.000000001); if (poly.isEmpty() || poly.first().isEmpty())
return false;
return (distance(poly.first().first(), poly.first().last()) < 0.000000001);
} }
static bool readSingleDelta(SubFile &subfile, const Coordinates &c, static bool readSingleDelta(SubFile &subfile, const Coordinates &c,
@ -620,20 +622,20 @@ bool MapData::readPaths(const VectorTile *tile, int zoom, QList<Path> *list)
return false; return false;
} }
if (flags & 0x08) { if (flags & 0x08) {
if (!subfile.readVUInt32(blocks) || !blocks) if (!subfile.readVUInt32(blocks))
return false; return false;
} else } else
blocks = 1; blocks = 1;
Q_ASSERT(blocks);
for (unsigned j = 0; j < blocks; j++) { for (unsigned j = 0; j < blocks; j++) {
if (!readPolygonPath(subfile, tile->pos, flags & 0x04, p.poly)) if (!readPolygonPath(subfile, tile->pos, flags & 0x04, p.poly))
return false; return false;
} }
const QVector<Coordinates> &outline = p.poly.first(); p.closed = isClosed(p.poly);
p.closed = isClosed(outline);
if (flags & 0x10) if (flags & 0x10)
p.labelPos = Coordinates(outline.first().lon() + MD(lon), p.labelPos = Coordinates(p.poly.first().first().lon() + MD(lon),
outline.first().lat() + MD(lat)); p.poly.first().first().lat() + MD(lat));
list->append(p); list->append(p);
} }

View File

@ -62,12 +62,13 @@ private:
class RenderInstruction class RenderInstruction
{ {
public: public:
RenderInstruction() : _render(0), _path(0), _point(0) {} RenderInstruction() : _pathRender(0), _circleRender(0), _path(0),
_point(0) {}
RenderInstruction(const Style::PathRender *render, PainterPath *path) RenderInstruction(const Style::PathRender *render, PainterPath *path)
: _render(render), _path(path), _point(0) {} : _pathRender(render), _circleRender(0), _path(path), _point(0) {}
RenderInstruction(const Style::CircleRender *render, RenderInstruction(const Style::CircleRender *render,
const MapData::Point *point) : _render(render), _path(0), const MapData::Point *point) : _pathRender(0), _circleRender(render),
_point(point) {} _path(0), _point(point) {}
bool operator<(const RenderInstruction &other) const bool operator<(const RenderInstruction &other) const
{ {
@ -77,10 +78,8 @@ private:
return (layer() < other.layer()); return (layer() < other.layer());
} }
const Style::PathRender *pathRender() const const Style::PathRender *pathRender() const {return _pathRender;}
{return static_cast<const Style::PathRender*>(_render);} const Style::CircleRender *circleRender() const {return _circleRender;}
const Style::CircleRender *circleRender() const
{return static_cast<const Style::CircleRender*>(_render);}
PainterPath *path() const {return _path;} PainterPath *path() const {return _path;}
const MapData::Point *point() const {return _point;} const MapData::Point *point() const {return _point;}
@ -88,12 +87,11 @@ private:
int layer() const {return _path ? _path->path->layer : _point->layer;} int layer() const {return _path ? _path->path->layer : _point->layer;}
int zOrder() const int zOrder() const
{ {
return _path return _pathRender ? _pathRender->zOrder() : _circleRender->zOrder();
? static_cast<const Style::PathRender*>(_render)->zOrder()
: static_cast<const Style::CircleRender*>(_render)->zOrder();
} }
const Style::Render *_render; const Style::PathRender *_pathRender;
const Style::CircleRender *_circleRender;
PainterPath *_path; PainterPath *_path;
const MapData::Point *_point; const MapData::Point *_point;
}; };