Change canvas cursor position logic (didn't work in Firefox).