[gnome-system-tools/rendering-cleanup: 18/21] e-map: Zoom out smoothly, too
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-system-tools/rendering-cleanup: 18/21] e-map: Zoom out smoothly, too
- Date: Tue, 5 Oct 2010 16:40:42 +0000 (UTC)
commit 074158ce18ede37bca0fc40baca65e3b07c85e30
Author: Benjamin Otte <otte redhat com>
Date: Tue Oct 5 18:24:10 2010 +0200
e-map: Zoom out smoothly, too
src/time/e-map/e-map.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/src/time/e-map/e-map.c b/src/time/e-map/e-map.c
index a6217c1..1e1667d 100644
--- a/src/time/e-map/e-map.c
+++ b/src/time/e-map/e-map.c
@@ -858,6 +858,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,
@@ -869,14 +871,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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]