[libchamplain: 17/45] Fix zooming animation.



commit e232259ab48bc0a65243b8702660ce76c1ed20e0
Author: Marius Stanciu <stanciumarius94 gmail com>
Date:   Mon Jun 20 17:50:22 2016 +0300

    Fix zooming animation.
    
    Add one extra clone since zooming out implies a larger viewport.
    Hide old clones while animating.

 champlain/champlain-view.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/champlain/champlain-view.c b/champlain/champlain-view.c
index e69aec6..ad1cb3c 100644
--- a/champlain/champlain-view.c
+++ b/champlain/champlain-view.c
@@ -1157,7 +1157,7 @@ update_clones (ChamplainView *view)
   map_size = get_map_width (view);
   clutter_actor_get_size (CLUTTER_ACTOR (view), &view_width, NULL);
 
-  priv->num_clones = ceil (view_width / map_size);
+  priv->num_clones = ceil (view_width / map_size) + 1;
 
   if (priv->clones != NULL)
     {
@@ -2831,14 +2831,17 @@ show_zoom_actor (ChamplainView *view,
 
       if (priv->hwrap) 
         {
+          GList *old_clone = priv->clones;
           for (i = 0; i < priv->num_clones; i++) 
             {
               ClutterActor *clone_right = clutter_clone_new (tile_container);
+              clutter_actor_hide (CLUTTER_ACTOR (old_clone->data));
               gfloat tiles_x;
 
               clutter_actor_get_position (tile_container, &tiles_x, NULL);
               clutter_actor_set_x (clone_right, tiles_x + (i * max_x_end * size));
 
+              old_clone = old_clone->next;
               clutter_actor_add_child (zoom_actor, clone_right);
             }
         }


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