pass the canvas into the nested element for simplicity