Closed fabiot21 closed 1 year ago
(this class could be extended to have more utility functions)
Maybe something like this
<Grid {...} let:controller={gridController} />
gridController.getAvailablePosition()
gridController.somethingUseful()
what about bind:controller={gridController}
or import { gridController } from '$lib'
? to have a reference outside the Grid
component
Add an utility or helper class that can return an available position within the grid given a new potential item (only
w
andh
) and current items. This helper could provide thex
andy
coordinates where the new item can be placed within the items.The function could be based on
getAvailablePosition