[gnome-shell] overviewControls: Clarify some code with a comment



commit 3e6c8e68b4a4431ca04133acec62c9083ebdb6cc
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Wed Sep 18 19:48:22 2013 -0400

    overviewControls: Clarify some code with a comment
    
    translationX is sort of a bad name, since it confuses with the
    actor's translation, which is used for sliding without allocation.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=694881

 js/ui/overviewControls.js |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 4128d6c..a415cc1 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -59,12 +59,14 @@ const SlideLayout = new Lang.Class({
         let availWidth = Math.round(box.x2 - box.x1);
         let availHeight = Math.round(box.y2 - box.y1);
 
+        // Align the actor inside the clipped box, as the actor's alignment
+        // flags only determine what to do if the allocated box is bigger
+        // than the actor's box.
         let realDirection = getRtlSlideDirection(this._direction, child);
-        let translationX = (realDirection == SlideDirection.LEFT) ?
-            (availWidth - natWidth) : (natWidth - availWidth);
+        let alignX = (realDirection == SlideDirection.LEFT) ? (availWidth - natWidth) : (natWidth - 
availWidth);
 
         let actorBox = new Clutter.ActorBox();
-        actorBox.x1 = translationX;
+        actorBox.x1 = alignX;
         actorBox.x2 = actorBox.x1 + child.x_expand ? availWidth : natWidth;
         actorBox.y1 = 0;
         actorBox.y2 = actorBox.y1 + child.y_expand ? availHeight : natHeight;


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