From a6772ebc894f03fac6717f547865335eef03a4e5 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Sun, 24 Aug 2008 08:11:20 -0400 Subject: [PATCH] Fix map-source property When switching, the current zoom level is saved and reapplied to the new source, there were not check if the new source supported such a zoom level. --- champlain/champlainview.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/champlain/champlainview.c b/champlain/champlainview.c index 91c6da2..ff1ed11 100644 --- a/champlain/champlainview.c +++ b/champlain/champlainview.c @@ -223,6 +223,10 @@ champlain_view_set_property(GObject* object, guint prop_id, const GValue* value, gint currentLevel = priv->map->current_level->level; map_free(priv->map); priv->map = map_new(priv->mapSource); + + if (currentLevel > priv->map->zoom_levels) + currentLevel = priv->map->zoom_levels; + map_load_level(priv->map, currentLevel); map_load_visible_tiles (priv->map, priv->viewportSize); clutter_container_add_actor (CLUTTER_CONTAINER (priv->viewport), priv->map->current_level->group); -- 2.39.5