[evolution/rendering-cleanup: 73/78] e-map: Introduce e_map_get_current_location()



commit 25d488d37ad5341ccfa40e05d7031d7ae20eddc4
Author: Benjamin Otte <otte redhat com>
Date:   Tue Oct 5 16:03:49 2010 +0200

    e-map: Introduce e_map_get_current_location()
    
    ... and use it when zooming out

 widgets/misc/e-map.c |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index 56c966b..3fde242 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -1361,28 +1361,28 @@ zoom_in (EMap *map)
 }
 
 static void
-zoom_out (EMap *map)
+e_map_get_current_location (EMap *map, double *longitude, double *latitude)
 {
 	GtkAllocation allocation;
-	GdkRectangle area;
+
+	gtk_widget_get_allocation (GTK_WIDGET (map), &allocation);
+
+	e_map_window_to_world (map,
+                               allocation.width / 2.0, allocation.height / 2.0,
+		               longitude, latitude);
+}
+
+static void
+zoom_out (EMap *map)
+{
 	EMapPrivate *priv;
 	gdouble longitude, latitude;
 	gdouble x, y;
 
 	priv = map->priv;
 
-	gtk_widget_get_allocation (GTK_WIDGET (map), &allocation);
-
-	area.x = 0;
-	area.y = 0;
-	area.width = allocation.width;
-	area.height = allocation.height;
-
 	/* Must be done before update_render_surface() */
-
-	e_map_window_to_world (
-		map, area.width / 2, area.height / 2,
-		&longitude, &latitude);
+        e_map_get_current_location (map, &longitude, &latitude);
 
 	priv->zoom_state = E_MAP_ZOOMED_OUT;
 	update_render_surface (map, TRUE);



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