mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-04-21 20:59:11 +02:00
Compare commits
No commits in common. "a281a68cbd8a501318a9b9ab84ec71ce44d86f1b" and "1304fd5c3c4b82b230d22274b3f089218c0ed9a3" have entirely different histories.
a281a68cbd
...
1304fd5c3c
@ -7,7 +7,7 @@
|
|||||||
#include "atlas.h"
|
#include "atlas.h"
|
||||||
|
|
||||||
|
|
||||||
#define ZOOM_THRESHOLD 0.8
|
#define ZOOM_THRESHOLD 0.9
|
||||||
|
|
||||||
#define TL(m) ((m)->xy2pp((m)->bounds().topLeft()))
|
#define TL(m) ((m)->xy2pp((m)->bounds().topLeft()))
|
||||||
#define BR(m) ((m)->xy2pp((m)->bounds().bottomRight()))
|
#define BR(m) ((m)->xy2pp((m)->bounds().bottomRight()))
|
||||||
|
@ -62,17 +62,9 @@ RectC Map::llBounds()
|
|||||||
|
|
||||||
qreal Map::resolution(const QRectF &rect)
|
qreal Map::resolution(const QRectF &rect)
|
||||||
{
|
{
|
||||||
/* The haversine formula used in Coordinates::distanceTo() only gives
|
qreal cy = rect.center().y();
|
||||||
"half world" distances and shorter so we have to use only the center
|
QPointF cl(rect.left(), cy);
|
||||||
"half rectangle" in case e.g. world map bounds are on the input */
|
QPointF cr(rect.right(), cy);
|
||||||
QRectF halfRect(QPointF(rect.left() + (rect.width() / 4.0),
|
|
||||||
rect.top() + (rect.height() / 4.0)),
|
|
||||||
QPointF(rect.right() - (rect.width() / 4.0),
|
|
||||||
rect.bottom() - (rect.height() / 4.0)));
|
|
||||||
|
|
||||||
qreal cy = halfRect.center().y();
|
|
||||||
QPointF cl(halfRect.left(), cy);
|
|
||||||
QPointF cr(halfRect.right(), cy);
|
|
||||||
|
|
||||||
qreal ds = xy2ll(cl).distanceTo(xy2ll(cr));
|
qreal ds = xy2ll(cl).distanceTo(xy2ll(cr));
|
||||||
qreal ps = QLineF(cl, cr).length();
|
qreal ps = QLineF(cl, cr).length();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user