#4259 Fixing some of the indentation and spacing of code. Also simplifying the logic of dispatching the mousemove event