Function rectangleForCell

Returns a visual rectangle of the cell, positioned from the top-left corner

const cell = { x: 1, y: 0 };

// 5x5 grid, each cell 5px in size
const grid = { rows: 5, cols: 5, size: 5 }

const r = rectangleForCell(grid, cell,);

// Yields: { x: 5, y: 0, width: 5, height: 5 }