[libchamplain] Make champlain_view_ensure_visible() easier to read



commit 592951f3d34f49c1b14ffd7c562a27b6f98a6210
Author: JiÅ?í Techet <techet gmail com>
Date:   Sat Mar 13 22:05:17 2010 +0100

    Make champlain_view_ensure_visible() easier to read
    
    Looking at the code again I realized that it was actually correct,
    but written in a bit hard-to-follow way. This patch makes it a bit easier
    to understand.
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-view.c |   15 ++++++---------
 1 files changed, 6 insertions(+), 9 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index 19bf72d..80847f3 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2751,16 +2751,13 @@ champlain_view_ensure_visible (ChamplainView *view,
         zoom_level--;
 
       if (zoom_level <= priv->min_zoom_level)
-        break;
-    }
-  while (good_size == FALSE);
-
-  // JT question - what's the purpose of this? The condition is never satisfied...
-  if (good_size == FALSE)
-    {
-      zoom_level = priv->min_zoom_level;
-      min_lat = min_lon = width = height = 0;
+        {
+          zoom_level = priv->min_zoom_level;
+          min_lat = min_lon = width = height = 0;
+          break;
+        }
     }
+  while (!good_size);
 
   DEBUG ("Ideal zoom level is %d", zoom_level);
   champlain_view_set_zoom_level (view, zoom_level);



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