aboutsummaryrefslogtreecommitdiffstats
path: root/widgets
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-10-06 00:24:10 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-30 01:50:03 +0800
commit963d59c44a22923bf0e32f5bc55710ff8eed7c5b (patch)
tree64f16301921d9f91b69a5a5dc04aa26075b1a9bb /widgets
parent6c15378fc0bb8c2cf2e8354465df742d54038970 (diff)
downloadgsoc2013-evolution-963d59c44a22923bf0e32f5bc55710ff8eed7c5b.tar
gsoc2013-evolution-963d59c44a22923bf0e32f5bc55710ff8eed7c5b.tar.gz
gsoc2013-evolution-963d59c44a22923bf0e32f5bc55710ff8eed7c5b.tar.bz2
gsoc2013-evolution-963d59c44a22923bf0e32f5bc55710ff8eed7c5b.tar.lz
gsoc2013-evolution-963d59c44a22923bf0e32f5bc55710ff8eed7c5b.tar.xz
gsoc2013-evolution-963d59c44a22923bf0e32f5bc55710ff8eed7c5b.tar.zst
gsoc2013-evolution-963d59c44a22923bf0e32f5bc55710ff8eed7c5b.zip
e-map: Zoom out smoothly, too
Diffstat (limited to 'widgets')
-rw-r--r--widgets/misc/e-map.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index 102e728833..288bc220eb 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -842,6 +842,8 @@ e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude)
e_map_set_zoom (map, E_MAP_ZOOMED_IN);
center_at (map, longitude, latitude);
+ /* need to reget location, centering might have clipped it */
+ e_map_get_current_location (map, &longitude, &latitude);
e_map_tween_new (map,
150,
@@ -853,14 +855,25 @@ e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude)
void
e_map_zoom_out (EMap *map)
{
- double longitude, latitude;
+ double longitude, latitude, actual_longitude, actual_latitude;
+ double prevzoom;
g_return_if_fail (map);
g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (map)));
e_map_get_current_location (map, &longitude, &latitude);
+ prevzoom = e_map_get_magnification (map);
e_map_set_zoom (map, E_MAP_ZOOMED_OUT);
center_at (map, longitude, latitude);
+
+ /* need to reget location, centering might have clipped it */
+ e_map_get_current_location (map, &actual_longitude, &actual_latitude);
+
+ e_map_tween_new (map,
+ 150,
+ longitude - actual_longitude,
+ latitude - actual_latitude,
+ prevzoom / e_map_get_magnification (map));
}
void