more reliable way to get mouse position on a canvas