[gnome-shell] iconGrid: Fix last item check on spring animation



commit 2a59478b3711f779fc1c5a3d2c4e9ca01b634147
Author: Carlos Soriano <carlos soriano89 gmail com>
Date:   Sat Sep 6 12:47:33 2014 +0200

    iconGrid: Fix last item check on spring animation
    
    Currently we consider the last item animating being the last actor of
    the list, but that's wrong since the last item animating depends on the
    distance between the source actor and the original position of the
    animated actor.
    
    Take that into account to check the last item of the animation.

 js/ui/iconGrid.js |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 0fc628e..d90cda4 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -521,11 +521,10 @@ const IconGrid = new Lang.Class({
             let scaleY = sourceScaledHeight / height;
             let [adjustedSourcePositionX, adjustedSourcePositionY] = [sourceCenterX - sourceScaledWidth / 2, 
sourceCenterY - sourceScaledHeight / 2];
 
-            // Defeat onComplete anonymous function closure
-            let isLastItem = index == actors.length - 1;
-
             let movementParams, fadeParams;
             if (animationDirection == AnimationDirection.IN) {
+                let isLastItem = actor._distance == minDist;
+
                 actorClone.opacity = 0;
                 actorClone.set_scale(scaleX, scaleY);
 
@@ -553,6 +552,8 @@ const IconGrid = new Lang.Class({
                                delay: delay,
                                opacity: 255 };
             } else {
+                let isLastItem = actor._distance == minDist;
+
                 let [startX, startY]  = actor._transformedPosition;
                 actorClone.set_position(startX, startY);
 


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