mrdoob/three.js — pull request #4749 by lpsinger (2014-05-02 07:41:41+00:00)
Title: OrbitControls handles mouse moving outside of window

OrbitControls will continue to follow the mouse position even after the
mouse button is up, if the user moves the cursor outside the window and
then releases it. The user must then click again inside the DOM element
to release the mouse tracking. See, for instance, the OrbitControls
example (http://threejs.org/examples/#misc_controls_orbit).

This can be fixed by attaching the `mousemove` and `mouseout` handlers
to `document` rather than `domElement`. This fix works on
Firefox 27.0.1, Safari 7.0.3, and Chrome 34.0.1847.131, on Mac OS
10.9.2.

Alternatively, the example could be changed to not pass a value for the
`domElement` argument, to get the default value of `document`.