[gnome-shell/gbsneto/40-stuff: 54/68] workspacesView: Fix off-by-one error




commit 8cb693e978dcdcc837f929c6f1fde69f3cffc7b2
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Jan 8 02:14:42 2021 +0100

    workspacesView: Fix off-by-one error
    
    The scroll adjustment's upper value corresponds to the number of
    workspaces, not to the last workspace index. We want the latter
    when mirroring the layout in RTL locales, so subtract 1.

 js/ui/workspacesView.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 4c28c4b2ff..0ab6b9eb1f 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -179,7 +179,7 @@ class WorkspacesView extends WorkspacesViewBase {
         const rtl = this.text_direction === Clutter.TextDirection.RTL;
         const adj = this._scrollAdjustment;
         const currentWorkspace = vertical || !rtl
-            ? adj.value : adj.upper - adj.value;
+            ? adj.value : adj.upper - adj.value - 1;
 
         // Snapped in the vertical axis also means horizontally centered
         let x1 = box.x1;


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