From 3e6c8e68b4a4431ca04133acec62c9083ebdb6cc Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 18 Sep 2013 19:48:22 -0400 Subject: [PATCH] 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 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index 4128d6ce6..a415cc1b0 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;