[gnome-shell] switcherPopup: Swap Math.max and Math.min in _scrollToLeft



commit 548c41d16415cda72d85a1ca5872f6cbef91072b
Author: Jonas Dreßler <verdre v0yd nl>
Date:   Wed Apr 25 23:56:29 2018 +0200

    switcherPopup: Swap Math.max and Math.min in _scrollToLeft
    
    Limit the minimum and maximum value to scroll to inside the box to 0 and
    the upper limit, for some reason this was done right in _scrollToRight,
    but not in _scrollToLeft.
    
    This fixes the behavior of scrolling to the left: Before, scrolling one
    item to the left moved the view to the first element of the list (this
    can make the selected element invisible in large lists). Instead, scroll
    one item to the left, just like scrolling to the right works.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/167

 js/ui/switcherPopup.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/switcherPopup.js b/js/ui/switcherPopup.js
index 16aa24c649..2f88ce5fed 100644
--- a/js/ui/switcherPopup.js
+++ b/js/ui/switcherPopup.js
@@ -480,9 +480,9 @@ var SwitcherList = GObject.registerClass({
         let item = this._items[index];
 
         if (item.allocation.x1 < value)
-            value = Math.min(0, item.allocation.x1);
+            value = Math.max(0, item.allocation.x1);
         else if (item.allocation.x2 > value + pageSize)
-            value = Math.max(upper, item.allocation.x2 - pageSize);
+            value = Math.min(upper, item.allocation.x2 - pageSize);
 
         this._scrollableRight = true;
         adjustment.ease(value, {


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