¡@

Home 

2014/10/15 ¤U¤È 10:12:36

iphone Programming Glossary: piece.transform

Using UIPinchGestureRecognizer to scale uiviews in single direction

http://stackoverflow.com/questions/6759028/using-uipinchgesturerecognizer-to-scale-uiviews-in-single-direction

1 vScale 1 NSLog @ gestureRecognizer scale f gestureRecognizer scale NSLog @ hScale f and vScale f hScale vScale piece.transform CGAffineTransformScale piece transform hScale vScale gestureRecognizer setScale 1 lastTouchPosition currentTouchLocation.. scaling along the horizontal and vertical axis. In this case the thing comes down to providing your affine transform piece.transform CGAffineTransformScale piece transform hScale vScale with different scaling factors. One way to calculate them is the following.. hScale abs deltaMove.x distance 1 gestureRecognizer.scale vScale abs deltaMove.y distance 1 gestureRecognizer.scale piece.transform CGAffineTransformScale piece transform hScale vScale gestureRecognizer setScale 1 lastTouchPosition currentTouchLocation..