mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 03:35:53 +01:00
Fixed path shape parsing
This commit is contained in:
parent
62fa0cce36
commit
1458d66798
@ -84,10 +84,7 @@ public:
|
||||
|
||||
bool readNext(qint32 &lonDelta, qint32 &latDelta)
|
||||
{
|
||||
if (!(readDelta(_lonSign, lonDelta) && readDelta(_latSign, latDelta)))
|
||||
return false;
|
||||
|
||||
return (lonDelta || latDelta);
|
||||
return (readDelta(_lonSign, lonDelta) && readDelta(_latSign, latDelta));
|
||||
}
|
||||
|
||||
protected:
|
||||
|
@ -152,6 +152,9 @@ bool NETFile::readLine(BitStream4R &bs, const SubDiv *subdiv,
|
||||
qint32 lonDelta, latDelta;
|
||||
|
||||
while (stream.readNext(lonDelta, latDelta)) {
|
||||
if (!(lonDelta | latDelta))
|
||||
break;
|
||||
|
||||
pos.rx() += LS(lonDelta, 32-subdiv->bits());
|
||||
if (pos.rx() < 0 && subdiv->lon() >= 0)
|
||||
pos.rx() = 0x7fffffff;
|
||||
@ -235,6 +238,8 @@ bool NETFile::readShape(const NODFile *nod, SubFile::Handle &nodHdl,
|
||||
|
||||
if (!stream.readNext(lonDelta, latDelta))
|
||||
break;
|
||||
if (!(lonDelta | latDelta) && !startWithStream)
|
||||
break;
|
||||
|
||||
if (hasAdjustBit && !stream.read(1, adjustBit))
|
||||
return false;
|
||||
|
@ -387,6 +387,9 @@ bool RGNFile::extPolyObjects(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
||||
poly.points.append(QPointF(c.lon(), c.lat()));
|
||||
|
||||
while (stream.readNext(lonDelta, latDelta)) {
|
||||
if (!(lonDelta | latDelta))
|
||||
break;
|
||||
|
||||
pos.rx() += LS(lonDelta, 32-subdiv->bits()-shift);
|
||||
if (pos.rx() < 0 && subdiv->lon() >= 0)
|
||||
pos.rx() = 0x7fffffff;
|
||||
|
Loading…
Reference in New Issue
Block a user