I have a view in which I am doing some specific drawings in drawRect. These drawings are dynamic and based on the width and height of the view. Then, in the view that contains it, the rotation transform is applied to it. However, this transformation seems to adjust the values โโfor my view, which affects my drawing in drawRect.
NSLog (@ "before:% F% F% F% F", button.frame.origin.x, button.frame.origin.y, button.frame.size.width, button.frame. Size.height);
CGAffineTransform currentTransform = button.transform;
CGAffineTransform transformRotate = CGAffineTransformMakeRotation(degreesToRadians);
button.transform = transformRotate;
NSLog(@"after:%f,%f,%f,%f",button.frame.origin.x,button.frame.origin.y,button.frame.size.width,button.frame.size.height);
Here is the result:
before: 50.000000,100.000000,150.000000,50.000000 after: 65.849365,47.548096,118.301262,154.903809
Is this the right behavior or the conversion is not applied correctly?
source