I'm having an issue with trying to invert a transform scale so to speak. Here is my code:
- (void)updateTransforms {
CGAffineTransform holeTransform = CGAffineTransformIdentity;
holeTransform = CGAffineTransformTranslate(holeTransform, _holeOffset.x, _holeOffset.y);
holeTransform = CGAffineTransformRotate(holeTransform, _holeRotation);
//Problem code:
holeTransform = CGAffineTransformScale(holeTransform, _holeScale, _holeScale);
self.transform = holeTransform;
self.imageToUse.transform = CGAffineTransformInvert(holeTransform); }
This is basically a method that lets me rotate, pan, and scale my object. The desired affect I want is the opposite of each action. So if you move left, the image moves right, rotate left, it rotates right, scale up, image scales down at the same rate. This code is working perfect so far for panning and rotating.
The problem I believe lies within inverting the scale, because scale doesn't actually go negative, it simply increases or decreases from 1.0. How can I modify my code to get scaling working right? Thanks.