Fix bounds check for mousemove events.

Closes #369