aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-10-05 22:03:49 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-30 01:50:03 +0800
commiteda95a9c337e6a14d562a73e455530c3d26c6080 (patch)
tree70eebdbf7bdb53dd991328327722a537e74dcd78
parentb5ee0e3e829b826ba283538a034ef27e0300a123 (diff)
downloadgsoc2013-evolution-eda95a9c337e6a14d562a73e455530c3d26c6080.tar
gsoc2013-evolution-eda95a9c337e6a14d562a73e455530c3d26c6080.tar.gz
gsoc2013-evolution-eda95a9c337e6a14d562a73e455530c3d26c6080.tar.bz2
gsoc2013-evolution-eda95a9c337e6a14d562a73e455530c3d26c6080.tar.lz
gsoc2013-evolution-eda95a9c337e6a14d562a73e455530c3d26c6080.tar.xz
gsoc2013-evolution-eda95a9c337e6a14d562a73e455530c3d26c6080.tar.zst
gsoc2013-evolution-eda95a9c337e6a14d562a73e455530c3d26c6080.zip
e-map: Introduce e_map_get_current_location()
... and use it when zooming out
-rw-r--r--widgets/misc/e-map.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index 56c966bf84..3fde242b8e 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);