From: Pierre-Luc Beaudoin Date: Wed, 29 Apr 2009 03:30:18 +0000 (-0400) Subject: Fix Bug 580371: demos/launcher doesn't start at the right position X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d46242afd0445ae7cf1b05cf5be3b8d9daa02be5;p=libchamplain Fix Bug 580371: demos/launcher doesn't start at the right position By retarding the creation of the map, there is less operations happening before the initial display, which in turns limit the possible occasions where the lat,lon can be skewed. --- diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c index fa43c81..9dc7f0e 100644 --- a/champlain/champlain-view.c +++ b/champlain/champlain-view.c @@ -356,16 +356,12 @@ static void resize_viewport (ChamplainView *view) { gdouble lower, upper; - gboolean center = FALSE; TidyAdjustment *hadjust, *vadjust; ChamplainViewPrivate *priv = view->priv; if (!priv->map) - { - create_initial_map (view); - center = TRUE; - } + return; clutter_actor_set_size (priv->finger_scroll, priv->viewport_size.width, priv->viewport_size.height); @@ -402,11 +398,6 @@ resize_viewport (ChamplainView *view) } g_object_set (vadjust, "lower", lower, "upper", upper, "page-size", 1.0, "step-increment", 1.0, "elastic", TRUE, NULL); - - if (center) - { - champlain_view_center_on (view, priv->latitude, priv->longitude); - } } static void @@ -1026,7 +1017,9 @@ champlain_view_center_on (ChamplainView *view, priv->latitude = latitude; if (!priv->map) - return; + { + create_initial_map (view); + } x = champlain_map_source_get_x (priv->map_source, priv->zoom_level, longitude); y = champlain_map_source_get_y (priv->map_source, priv->zoom_level, latitude);