improve click position calculation, use context.save()/restore()