Fixed a bug in MapEngine::centerAndZoomTo()
authorSami Rämö <sami.ramo@ixonos.com>
Wed, 1 Sep 2010 10:34:04 +0000 (13:34 +0300)
committerSami Rämö <sami.ramo@ixonos.com>
Wed, 1 Sep 2010 10:38:04 +0000 (13:38 +0300)
 - Horizontal and vertical margins were mixed

 - Also decreased the horizontal margin value

src/map/mapengine.cpp

index 0675e1f..77a87f6 100644 (file)
@@ -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