Added function to centre components on canvas