1
0
mirror of https://github.com/tumic0/GPXSee.git synced 2024-10-06 06:43:22 +02:00

Fixed track zoom computation on Qt5

This commit is contained in:
Martin Tůma 2015-11-25 00:10:11 +01:00
parent b0cafe69d0
commit 0c002bc1e9

View File

@ -85,16 +85,16 @@ qreal Track::trackScale() const
{ {
qreal bottom, top, left, right; qreal bottom, top, left, right;
bottom = _trackPaths.at(0)->boundingRect().bottom(); bottom = _trackPaths.at(0)->path().boundingRect().bottom();
top = _trackPaths.at(0)->boundingRect().top(); top = _trackPaths.at(0)->path().boundingRect().top();
left = _trackPaths.at(0)->boundingRect().left(); left = _trackPaths.at(0)->path().boundingRect().left();
right = _trackPaths.at(0)->boundingRect().right(); right = _trackPaths.at(0)->path().boundingRect().right();
for (int i = 1; i < _trackPaths.size(); i++) { for (int i = 1; i < _trackPaths.size(); i++) {
bottom = qMax(bottom, _trackPaths.at(i)->boundingRect().bottom()); bottom = qMax(bottom, _trackPaths.at(i)->path().boundingRect().bottom());
top = qMin(top, _trackPaths.at(i)->boundingRect().top()); top = qMin(top, _trackPaths.at(i)->path().boundingRect().top());
right = qMax(right, _trackPaths.at(i)->boundingRect().right()); right = qMax(right, _trackPaths.at(i)->path().boundingRect().right());
left = qMin(left, _trackPaths.at(i)->boundingRect().left()); left = qMin(left, _trackPaths.at(i)->path().boundingRect().left());
} }
QRectF br(QPointF(left, top), QPointF(right, bottom)); QRectF br(QPointF(left, top), QPointF(right, bottom));