mirror of
https://github.com/tumic0/GPXSee.git
synced 2024-11-24 19:55:53 +01:00
15 lines
273 B
C++
15 lines
273 B
C++
#include <QLineF>
|
|
#include "map.h"
|
|
|
|
qreal Map::resolution(const QRectF &rect)
|
|
{
|
|
qreal cy = rect.center().y();
|
|
QPointF cl(rect.left(), cy);
|
|
QPointF cr(rect.right(), cy);
|
|
|
|
qreal ds = xy2ll(cl).distanceTo(xy2ll(cr));
|
|
qreal ps = QLineF(cl, cr).length();
|
|
|
|
return ds/ps;
|
|
}
|