Column: rename isToTheLeftOf and isToTheRightOf

This commit is contained in:
Peter Fajdiga
2024-07-08 12:22:46 +02:00
parent fdb4b88333
commit b85c86e7db
3 changed files with 6 additions and 6 deletions

View File

@@ -286,7 +286,7 @@ namespace Actions {
if (targetColumn === null || targetColumn === column) {
return;
}
if (targetColumn.isAfter(column)) {
if (targetColumn.isToTheRightOf(column)) {
grid.moveColumn(column, targetColumn);
} else {
grid.moveColumn(column, grid.getPrevColumn(targetColumn));

View File

@@ -30,12 +30,12 @@ class Column {
}
}
public isAfter(other: Column) {
return this.gridX > other.gridX;
public isToTheLeftOf(other: Column) {
return this.gridX < other.gridX;
}
public isBefore(other: Column) {
return this.gridX < other.gridX;
public isToTheRightOf(other: Column) {
return this.gridX > other.gridX;
}
public moveWindowUp(window: Window) {

View File

@@ -28,7 +28,7 @@ class Grid {
if (column === prevColumn) {
return;
}
const movedLeft = prevColumn === null ? true : column.isAfter(prevColumn);
const movedLeft = prevColumn === null ? true : column.isToTheRightOf(prevColumn);
const firstMovedColumn = movedLeft ? column : this.getNextColumn(column);
this.columns.move(column, prevColumn);
this.columnsSetX(firstMovedColumn);