From bad680975c65d6cf021fec5d04ddc428c343116e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Hedin=20Br=C3=B8nner?= Date: Tue, 24 Jul 2018 18:11:20 +0200 Subject: [PATCH] layout: Center correctly Subtract the last added gap --- tiling.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tiling.js b/tiling.js index d64fa3d..748b866 100644 --- a/tiling.js +++ b/tiling.js @@ -234,7 +234,7 @@ class Space extends Array { this._inLayout = false; if (x < this.width) { - this.targetX = Math.round((this.width - x)/2); + this.targetX = Math.round((this.width - (x - gap))/2); } if (animate) { Tweener.addTween(this.cloneContainer,