From 31bbc0c449f00ca4a9536f16938c0ff98c6fe35a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sami=20R=C3=A4m=C3=B6?= Date: Wed, 1 Sep 2010 13:34:04 +0300 Subject: [PATCH] Fixed a bug in MapEngine::centerAndZoomTo() - Horizontal and vertical margins were mixed - Also decreased the horizontal margin value --- src/map/mapengine.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/map/mapengine.cpp b/src/map/mapengine.cpp index 0675e1f..77a87f6 100644 --- a/src/map/mapengine.cpp +++ b/src/map/mapengine.cpp @@ -139,13 +139,13 @@ void MapEngine::centerAndZoomTo(QRect rect, bool useMargins) int marginVertical = 0; if (useMargins) { - marginHorizontal = 50; + marginHorizontal = 5; marginVertical = 5; } // calculate the usable size of the view - int viewUsableHeight = m_viewSize.height() - 2 * marginHorizontal; - int viewUsableWidth = m_viewSize.width() - 2 * marginVertical; + int viewUsableHeight = m_viewSize.height() - 2 * marginVertical; + int viewUsableWidth = m_viewSize.width() - 2 * marginHorizontal; // calculate how many levels must be zoomed out from the closest zoom level to get the rect // fit inside the usable view area -- 1.7.9.5