From b21c8c1290247e869a34427fb08927e5f2af0b6d Mon Sep 17 00:00:00 2001 From: Alexander Mikhaylenko Date: Sat, 11 Jan 2020 01:58:24 +0500 Subject: [PATCH] workspacesView: Round workspace position Prevent blurring when scrolling workspaces by aligning it to pixel grid, and be consistent with app grid. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/930 --- js/ui/workspacesView.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js index 975dd0760..2dd1ae490 100644 --- a/js/ui/workspacesView.js +++ b/js/ui/workspacesView.js @@ -314,7 +314,7 @@ class WorkspacesView extends WorkspacesViewBase { let workspacesHeight = lastWorkspaceY - firstWorkspaceY; let currentY = firstWorkspaceY; - let newY = -adj.value / (adj.upper - 1) * workspacesHeight; + let newY = -Math.round(adj.value / (adj.upper - 1) * workspacesHeight); let dy = newY - currentY; @@ -328,7 +328,7 @@ class WorkspacesView extends WorkspacesViewBase { let workspacesWidth = lastWorkspaceX - firstWorkspaceX; let currentX = firstWorkspaceX; - let newX = -adj.value / (adj.upper - 1) * workspacesWidth; + let newX = -Math.round(adj.value / (adj.upper - 1) * workspacesWidth); let dx = newX - currentX;