From: Sami Rämö Date: Wed, 1 Sep 2010 10:34:04 +0000 (+0300) Subject: Fixed a bug in MapEngine::centerAndZoomTo() X-Git-Tag: v2.0b-1~17^2~15^2~2 X-Git-Url: http://git.maemo.org/git/?p=situare;a=commitdiff_plain;h=31bbc0c449f00ca4a9536f16938c0ff98c6fe35a Fixed a bug in MapEngine::centerAndZoomTo() - Horizontal and vertical margins were mixed - Also decreased the horizontal margin value --- 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