[libchamplain] champlain-view: Add safety check to view_find_suitable_zoom function



commit f60d6d9cb4c4899795ed060faccea36d458b4ffd
Author: Marius Stanciu <stanciumarius94 gmail com>
Date:   Wed Apr 6 00:22:39 2016 +0300

    champlain-view: Add safety check to view_find_suitable_zoom function
    
    https://bugzilla.gnome.org/show_bug.cgi?id=764662

 champlain/champlain-view.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index bb4850c..62c4aa7 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1203,13 +1203,13 @@ view_find_suitable_zoom (ChamplainView *view,
   ChamplainViewPrivate *priv = GET_PRIVATE (view);
   guint zoom_level = priv->initial_gesture_zoom;
 
-  while (factor > 2)
+  while (factor > 2 && zoom_level <= priv->max_zoom_level)
     {
       factor /= 2;
       zoom_level++;
     }
 
-  while (factor < 0.5)
+  while (factor < 0.5 && zoom_level >= priv->min_zoom_level)
     {
       factor *= 2;
       zoom_level--;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]