space.layout: compare against correct width when centering

This commit is contained in:
Tor Hedin Brønner
2018-08-26 19:41:54 +02:00
parent a4f8cd1e3f
commit 758f8ce750
+4 -2
View File
@@ -263,8 +263,10 @@ class Space extends Array {
}
this._inLayout = false;
if (x < this.width) {
this.targetX = Math.round((this.width - (x - gap))/2);
let width = x - gap;
this.cloneContainer.width = width;
if (width < this.width) {
this.targetX = Math.round((this.width - width)/2);
}
if (animate) {
Tweener.addTween(this.cloneContainer,