diff --git a/frontend/src/lib/components/apps/svelte-grid/utils/helper.ts b/frontend/src/lib/components/apps/svelte-grid/utils/helper.ts index 8d4ce2c88d..9022c7ee44 100644 --- a/frontend/src/lib/components/apps/svelte-grid/utils/helper.ts +++ b/frontend/src/lib/components/apps/svelte-grid/utils/helper.ts @@ -26,7 +26,6 @@ const gridHelp = { findSpace(item, items, cols) { let matrix = makeMatrixFromItems(items, getRowsCount(items, cols), cols) - let position = findFreeSpaceForItem(matrix, item[cols]) return position } diff --git a/frontend/src/lib/components/apps/svelte-grid/utils/item.ts b/frontend/src/lib/components/apps/svelte-grid/utils/item.ts index 555b4e4827..7f9be5ec6b 100644 --- a/frontend/src/lib/components/apps/svelte-grid/utils/item.ts +++ b/frontend/src/lib/components/apps/svelte-grid/utils/item.ts @@ -33,7 +33,7 @@ export function findFreeSpaceForItem(matrix: FilledItem[][], item: ItemLay const cols = matrix[0].length const w = Math.min(cols, item.w) const h = item.h - let xNtime = cols - w + let xNtime = cols - w + 1 let getMatrixRows = matrix.length const range = Array.from({ length: getMatrixRows }, (_, y) => @@ -57,7 +57,7 @@ export function findFreeSpaceForItem(matrix: FilledItem[][], item: ItemLay return { x, y } } } - + return { y: getMatrixRows, x: 0