Reimplemented panning.

No bugs found :/