Fixed Firefox issue with x/y calculation