canvas pan bug fixing