Zoom/Pan constraints

It seems that you do not run the code or you do not understand my intent at all. I thank you for the help but I’ll wait for someone else maybe know how to help me.