Fix the issue of cannot moving on Firefox browser.

Firefox do not support event.offsetX and event.offsetY.
If offsetX is undefined, using layerX and layerY.