I'm trying to recreate the behaviour of the photos app, where you can pan, pinch and rotate simultaneously. I have the basics working, but I'm stuck on something.
For the pan, I offset the centrepoint of the view by the translation amount. This is working well.
For the pinch and rotate I'm applying an affine transform to the view. This is also working well.
The problem is when I pan (ie. move the subview), and then pinch or rotate - the affine transform seems to get applied using the old centre point of the view. I though that it should use the current centre point as the transform origin - as I'm updating the centrepoint when I pan I though that this should work. Instead of a rotation about the centrepoint of the subview, I get a rotational movement about the original centrepoint.
How do I correct this ? It's clearly possible to combine these three gestures intuitively, as the photos app does it successfully.
I tried using an affine translation for the pan, but the effect was the same.
Apple have confirmed this appears to be a bug with the way that gesture recognisers are working in iPhone OS 3.2. I have filed a bug report.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With