Desktop.clampScrollX: simplify

This commit is contained in:
Peter Fajdiga
2023-12-02 20:38:14 +01:00
parent 0e5efd2be7
commit d7346a6fab

View File

@@ -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);
}