[gnome-shell/wip/jimmac/dash-icon-spacing: 55/72] workspacesView: Fix off-by-one error




commit e94efcc2818616f677fc803970f72ff1a9b7b13d
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 f56e2cc9e0..8c6b6b484b 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]