Fit the grid to the canvas