Fix off-by-one error in panning.

I don't actually know the origin/rationale of this, so I'm not sure it is correct, except that "it works for me."