Fix distance calculation for panning animation when you are panning
right.