mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-27 21:24:47 +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)
|
bool readNext(qint32 &lonDelta, qint32 &latDelta)
|
||||||
{
|
{
|
||||||
if (!(readDelta(_lonSign, lonDelta) && readDelta(_latSign, latDelta)))
|
return (readDelta(_lonSign, lonDelta) && readDelta(_latSign, latDelta));
|
||||||
return false;
|
|
||||||
|
|
||||||
return (lonDelta || latDelta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -152,6 +152,9 @@ bool NETFile::readLine(BitStream4R &bs, const SubDiv *subdiv,
|
|||||||
qint32 lonDelta, latDelta;
|
qint32 lonDelta, latDelta;
|
||||||
|
|
||||||
while (stream.readNext(lonDelta, latDelta)) {
|
while (stream.readNext(lonDelta, latDelta)) {
|
||||||
|
if (!(lonDelta | latDelta))
|
||||||
|
break;
|
||||||
|
|
||||||
pos.rx() += LS(lonDelta, 32-subdiv->bits());
|
pos.rx() += LS(lonDelta, 32-subdiv->bits());
|
||||||
if (pos.rx() < 0 && subdiv->lon() >= 0)
|
if (pos.rx() < 0 && subdiv->lon() >= 0)
|
||||||
pos.rx() = 0x7fffffff;
|
pos.rx() = 0x7fffffff;
|
||||||
@ -235,6 +238,8 @@ bool NETFile::readShape(const NODFile *nod, SubFile::Handle &nodHdl,
|
|||||||
|
|
||||||
if (!stream.readNext(lonDelta, latDelta))
|
if (!stream.readNext(lonDelta, latDelta))
|
||||||
break;
|
break;
|
||||||
|
if (!(lonDelta | latDelta) && !startWithStream)
|
||||||
|
break;
|
||||||
|
|
||||||
if (hasAdjustBit && !stream.read(1, adjustBit))
|
if (hasAdjustBit && !stream.read(1, adjustBit))
|
||||||
return false;
|
return false;
|
||||||
|
@ -387,6 +387,9 @@ bool RGNFile::extPolyObjects(Handle &hdl, const SubDiv *subdiv, quint32 shift,
|
|||||||
poly.points.append(QPointF(c.lon(), c.lat()));
|
poly.points.append(QPointF(c.lon(), c.lat()));
|
||||||
|
|
||||||
while (stream.readNext(lonDelta, latDelta)) {
|
while (stream.readNext(lonDelta, latDelta)) {
|
||||||
|
if (!(lonDelta | latDelta))
|
||||||
|
break;
|
||||||
|
|
||||||
pos.rx() += LS(lonDelta, 32-subdiv->bits()-shift);
|
pos.rx() += LS(lonDelta, 32-subdiv->bits()-shift);
|
||||||
if (pos.rx() < 0 && subdiv->lon() >= 0)
|
if (pos.rx() < 0 && subdiv->lon() >= 0)
|
||||||
pos.rx() = 0x7fffffff;
|
pos.rx() = 0x7fffffff;
|
||||||
|
Loading…
Reference in New Issue
Block a user