overviewControls: fix math for translations when sliding in

The math to compute translations was wrong when sliding in; also, don't
depend on the slide value for the translation anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=694064
This commit is contained in:
Cosimo Cecchi 2013-02-18 01:24:40 -05:00
parent d9770dcffb
commit 4505c38b58

View File

@ -125,14 +125,12 @@ const SlidingControl = new Lang.Class({
_getTranslation: function() { _getTranslation: function() {
let child = this.actor.get_first_child(); let child = this.actor.get_first_child();
let direction = getRtlSlideDirection(this.layout.slideDirection, child); let direction = getRtlSlideDirection(this.layout.slideDirection, child);
let slide = this.getSlide();
let visibleWidth = this.getVisibleWidth(); let visibleWidth = this.getVisibleWidth();
if (direction == SlideDirection.LEFT) if (direction == SlideDirection.LEFT)
return ((slide - 1) * visibleWidth); return - visibleWidth;
else else
return ((1 - slide) * visibleWidth); return visibleWidth;
}, },
_updateTranslation: function(slidingIn) { _updateTranslation: function(slidingIn) {