ScrollView: refactor scrollCenterColumn

This commit is contained in:
Peter Fajdiga
2023-07-07 12:47:10 +02:00
parent fa17b1fcc2
commit 0a3ba5c963

View File

@@ -67,8 +67,8 @@ class ScrollView {
}
scrollCenterColumn(column: Column) {
const windowCenter = this.gridToTilingSpace(column.getLeft() + column.width / 2 + this.world.config.gapsInnerHorizontal);
const screenCenter = this.tilingArea.x + this.tilingArea.width / 2;
const windowCenter = column.getLeft() + column.width / 2;
const screenCenter = this.scrollX + this.tilingArea.width / 2;
this.adjustScroll(Math.round(windowCenter - screenCenter), false);
}