added snippet for calculating mouse position on canvas