ios - Limit the min value of videoZoomFactor when pinching to zoom. -


when pinch zoom using method below videozoomfactor go below 1 , app crash. how can modify method when try zoom min value zoom factor doesn't go below 1. looking natural zoom , not adding pinch scale factor 1.

-(void) handlepinchtozoomrecognizer:(uipinchgesturerecognizer*)pinchrecognizer {  const cgfloat pinchvelocitydividerfactor = 5.0f;    nslog(@"%f", atan(pinchrecognizer.velocity / pinchvelocitydividerfactor)); if (pinchrecognizer.state == uigesturerecognizerstatechanged) {     nserror *error = nil;     if ([inputdevice lockforconfiguration:&error]) {         inputdevice.videozoomfactor = inputdevice.videozoomfactor + atan(pinchrecognizer.velocity / pinchvelocitydividerfactor);         [inputdevice unlockforconfiguration];     } else {         nslog(@"error: %@", error);     } } } 


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -