How to get a consistent offset on a zooming camera

Hi, this is the latest version we used in our project, here we have no more problems as described before.

I have a few versions according different kinds of inputs, but this base can be use for all.