[libchamplain] Set tile size during its creation



commit ace942a2d9bdad1e1ae94a4564947828129beba5
Author: JiÅ?í Techet <techet gmail com>
Date:   Fri Mar 12 00:44:45 2010 +0100

    Set tile size during its creation
    
    Set the tile size once when created and eliminate all the tile size
    settings in the map sources.
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-error-tile-source.c   |    1 -
 champlain/champlain-file-cache.c          |    1 -
 champlain/champlain-memphis-tile-source.c |    2 --
 champlain/champlain-network-tile-source.c |    1 -
 champlain/champlain-view.c                |    6 +++++-
 5 files changed, 5 insertions(+), 6 deletions(-)
---
diff --git a/champlain/champlain-error-tile-source.c b/champlain/champlain-error-tile-source.c
index e3fbea1..e56968d 100644
--- a/champlain/champlain-error-tile-source.c
+++ b/champlain/champlain-error-tile-source.c
@@ -148,6 +148,5 @@ fill_tile (ChamplainMapSource *map_source, ChamplainTile *tile)
   clone = clutter_clone_new (priv->error_actor);
 
   champlain_tile_set_content (tile, clone, TRUE);
-  champlain_tile_set_size (tile, size);
   champlain_tile_set_state (tile, CHAMPLAIN_STATE_DONE);
 }
diff --git a/champlain/champlain-file-cache.c b/champlain/champlain-file-cache.c
index e79c9b2..71c6c6a 100644
--- a/champlain/champlain-file-cache.c
+++ b/champlain/champlain-file-cache.c
@@ -600,7 +600,6 @@ tile_loaded_cb (ClutterTexture *texture,
     }
 
   champlain_tile_set_content (tile, actor, FALSE);
-  champlain_tile_set_size (tile, champlain_map_source_get_tile_size (map_source));
 
   /* Retrieve modification time */
   file = g_file_new_for_path (filename);
diff --git a/champlain/champlain-memphis-tile-source.c b/champlain/champlain-memphis-tile-source.c
index 00d39b9..59b9b31 100644
--- a/champlain/champlain-memphis-tile-source.c
+++ b/champlain/champlain-memphis-tile-source.c
@@ -487,8 +487,6 @@ fill_tile (ChamplainMapSource *map_source, ChamplainTile *tile)
 
       g_object_ref (map_source);
 
-      champlain_tile_set_size (tile, data->size);
-
       g_thread_pool_push (priv->thpool, data, &error);
       if (error)
         {
diff --git a/champlain/champlain-network-tile-source.c b/champlain/champlain-network-tile-source.c
index beeddc9..40cdffd 100644
--- a/champlain/champlain-network-tile-source.c
+++ b/champlain/champlain-network-tile-source.c
@@ -626,7 +626,6 @@ tile_loaded_cb (SoupSession *session,
     }
 
   champlain_tile_set_content (tile, actor, TRUE);
-  champlain_tile_set_size (tile, champlain_map_source_get_tile_size (map_source));
 
   goto finish;
 
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index fbc8e0e..0d684d0 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -2308,10 +2308,14 @@ view_load_visible_tiles (ChamplainView *view)
                   if(!exist)
                     {
                       ChamplainTile *tile;
+                      guint tile_size;
 
                       DEBUG ("Loading tile %d, %d, %d", champlain_zoom_level_get_zoom_level (level), i, j);
                       tile = champlain_tile_new ();
-                      g_object_set (G_OBJECT (tile), "x", i, "y", j, "zoom-level", champlain_zoom_level_get_zoom_level (level), NULL);
+                      tile_size = champlain_map_source_get_tile_size (priv->map_source);
+                      g_object_set (G_OBJECT (tile), "x", i, "y", j,
+                                    "zoom-level", champlain_zoom_level_get_zoom_level (level),
+                                    "size", tile_size, NULL);
                       g_signal_connect (tile, "notify::state", G_CALLBACK (tile_state_notify), view);
                       clutter_container_add_actor (CLUTTER_CONTAINER (level), CLUTTER_ACTOR (tile));
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]