fix for pan of canvas