Fixed pan origin bug