Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,10 @@ export const placeTableWithoutOverlap = (
): TableVm => {
let newTable = table;
let attempts = 0;

while (
doesTableOverlap(newTable, tables) &&
attempts < TABLE_CONST.MAX_PLACEMENT_ATTEMPTS
attempts < TABLE_CONST.MAX_PLACEMENT_ATTEMPTS
) {
newTable = {
...newTable,
Expand All @@ -113,6 +113,12 @@ export const placeTableWithoutOverlap = (
attempts++;
}

// If relocated table still overlaps, restore original posotion.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Suggested change
// If relocated table still overlaps, restore original posotion.
// If relocated table still overlaps, restore original position.

if ((newTable.width) && (newTable.width > TABLE_CONST.TABLE_SHIFT_DISTANCE) && doesTableOverlap(newTable, tables)) {
newTable.x = table.x;
newTable.y = table.y;
}

return newTable;
};

Expand Down