mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-28 05:34:47 +01:00
Fixed map fitting algorithm
This commit is contained in:
parent
f0b7abdb72
commit
8bc575aef2
@ -83,21 +83,17 @@ void Atlas::computeBounds()
|
||||
qSort(m.begin(), m.end(), xCmp);
|
||||
offsets[_maps.indexOf(m.first())].setX(w);
|
||||
for (int i = 1; i < m.size(); i++) {
|
||||
if (TL(m.at(i)).x() > TL(m.at(i-1)).x()) {
|
||||
w += round(m.at(i-1)->pp2xy(TL(m.at(i))).x());
|
||||
offsets[_maps.indexOf(m.at(i))].setX(w);
|
||||
}
|
||||
}
|
||||
|
||||
qSort(m.begin(), m.end(), yCmp);
|
||||
offsets[_maps.indexOf(m.first())].setY(h);
|
||||
for (int i = 1; i < m.size(); i++) {
|
||||
if (TL(m.at(i)).y() < TL(m.at(i-1)).y()) {
|
||||
h += round(m.at(i-1)->pp2xy(TL(m.at(i))).y());
|
||||
offsets[_maps.indexOf(m.at(i))].setY(h);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < _maps.count(); i++)
|
||||
_bounds.append(QPair<QRectF, QRectF>(QRectF(TL(_maps.at(i)),
|
||||
|
Loading…
Reference in New Issue
Block a user