[canvas] Fix an error in clearLine