From 214d7c40dc9037955a769a43f0b4a3e0eb03a01c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Fri, 3 Feb 2017 00:54:57 +0100 Subject: [PATCH] Added missing coordinates bounding rectangle normalization (Fixes issue #19) --- src/coordinates.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/coordinates.cpp b/src/coordinates.cpp index 239092fe..34e21e14 100644 --- a/src/coordinates.cpp +++ b/src/coordinates.cpp @@ -64,6 +64,7 @@ QPair Coordinates::boundingRect(qreal distance) const maxLon = MAX_LON; } - return QPair(Coordinates(rad2deg(minLon), - rad2deg(minLat)), Coordinates(rad2deg(maxLon), rad2deg(maxLat))); + return QPair(Coordinates(rad2deg(qMin(minLon, + maxLon)), rad2deg(qMin(minLat, maxLat))), Coordinates(rad2deg(qMax(minLon, + maxLon)), rad2deg(qMax(minLat, maxLat)))); }