Adjustment to the updated canvas API.