aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2010-10-19 16:49:12 +0800
committerMatthew Barnes <mbarnes@redhat.com>2010-10-30 01:50:02 +0800
commita21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35 (patch)
tree1a498f18b50683429513567fd99223c9b846e795
parent26c62ff150bdc250e7f85c84b53eedb280b6d9da (diff)
downloadgsoc2013-evolution-a21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35.tar
gsoc2013-evolution-a21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35.tar.gz
gsoc2013-evolution-a21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35.tar.bz2
gsoc2013-evolution-a21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35.tar.lz
gsoc2013-evolution-a21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35.tar.xz
gsoc2013-evolution-a21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35.tar.zst
gsoc2013-evolution-a21ae31d94a2e7a90a884cdf6ec5b8d14fc89b35.zip
e-map: Update the xofs/yofs properties together with the adjustments
-rw-r--r--widgets/misc/e-map.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c
index 9c4f3cf6e8..523dc0c970 100644
--- a/widgets/misc/e-map.c
+++ b/widgets/misc/e-map.c
@@ -95,7 +95,7 @@ static void e_map_set_scroll_adjustments (GtkWidget *widget, GtkAdjustment *hadj
static void update_render_pixbuf (EMap *map, GdkInterpType interp, gboolean render_overlays);
static void set_scroll_area (EMap *view);
-static void center_at (EMap *map, gint x, gint y, gboolean scroll);
+static void center_at (EMap *map, gint x, gint y);
static void smooth_center_at (EMap *map, gint x, gint y);
static void scroll_to (EMap *view, gint x, gint y);
static void zoom_do (EMap *map);
@@ -1014,7 +1014,7 @@ repaint_point (EMap *map, EMapPoint *point)
}
static void
-center_at (EMap *map, gint x, gint y, gboolean scroll)
+center_at (EMap *map, gint x, gint y)
{
EMapPrivate *priv;
GtkAllocation allocation;
@@ -1030,12 +1030,10 @@ center_at (EMap *map, gint x, gint y, gboolean scroll)
x = CLAMP (x - (allocation.width / 2), 0, pb_width - allocation.width);
y = CLAMP (y - (allocation.height / 2), 0, pb_height - allocation.height);
- if (scroll)
- scroll_to (map, x, y);
- else {
- priv->xofs = x;
- priv->yofs = y;
- }
+ priv->xofs = x;
+ priv->yofs = y;
+ gtk_adjustment_set_value (priv->hadj, priv->xofs);
+ gtk_adjustment_set_value (priv->vadj, priv->yofs);
}
static void
@@ -1357,6 +1355,8 @@ zoom_in_smooth (EMap *map)
e_map_world_to_window (map, priv->zoom_target_long, priv->zoom_target_lat, &x, &y);
priv->xofs = CLAMP (priv->xofs + x - allocation.width / 2.0, 0, E_MAP_GET_WIDTH (map) - allocation.width);
priv->yofs = CLAMP (priv->yofs + y - allocation.height / 2.0, 0, E_MAP_GET_HEIGHT (map) - allocation.height);
+ gtk_adjustment_set_value (priv->hadj, priv->xofs);
+ gtk_adjustment_set_value (priv->vadj, priv->yofs);
gtk_widget_draw (GTK_WIDGET (map), NULL);
}
@@ -1417,7 +1417,7 @@ zoom_out (EMap *map)
update_render_pixbuf (map, GDK_INTERP_BILINEAR, TRUE);
e_map_world_to_window (map, longitude, latitude, &x, &y);
- center_at (map, x + priv->xofs, y + priv->yofs, FALSE);
+ center_at (map, x + priv->xofs, y + priv->yofs);
gtk_widget_queue_draw (GTK_WIDGET (map));
}
@@ -1439,8 +1439,6 @@ zoom_do (EMap *map)
/* if (e_map_get_smooth_zoom(map)) zoom_out_smooth(map); */
zoom_out (map);
}
-
- set_scroll_area (map);
}
/* Callback used when an adjustment is changed */