开发者

preventing zooming at some limit

开发者 https://www.devze.com 2023-01-08 13:17 出处:网络
In my ipad openGL based application I am drawing a 2D and 3D object and rotating it according to the user\'s finger motion....On pinching the screen user is enable to zoom those objects...But what I w

In my ipad openGL based application I am drawing a 2D and 3D object and rotating it according to the user's finger motion....On pinching the screen user is enable to zoom those objects...But what I want 开发者_如何学JAVAis to prevent zooming the object at some limit, say more than 2x of the object size user cannot zoom in and user cannot zoom out more than object's original size

I am zooming the object with help of "CATransform3DScale"

Any hint please....

Thanks in advance and help appreciated.


If you are using the UIPinchGestureRecognizer and setting the scale value of it directly as your 3D scale value then just do something like

if(scale >= 2.0f){
   scale = 2.0f;
}

that's basically what i do.

0

精彩评论

暂无评论...
验证码 换一张
取 消