From d7346a6fab59092b6570d7946c54c6ce5e11d9f1 Mon Sep 17 00:00:00 2001 From: Peter Fajdiga Date: Sat, 2 Dec 2023 20:38:14 +0100 Subject: [PATCH] Desktop.clampScrollX: simplify --- src/layout/Desktop.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/layout/Desktop.ts b/src/layout/Desktop.ts index 5624cf6..7bef942 100644 --- a/src/layout/Desktop.ts +++ b/src/layout/Desktop.ts @@ -118,9 +118,7 @@ class Desktop { let minScroll = 0; let maxScroll = this.grid.getWidth() - this.tilingArea.width; if (maxScroll < 0) { - const centerScroll = Math.round(maxScroll / 2); - minScroll = centerScroll; - maxScroll = centerScroll; + return Math.round(maxScroll / 2); } return clamp(x, minScroll, maxScroll); }