I have a view with a frame defined as (0,0,320,480).
I invoke the conversion on this view:
self.myView.transform = CGAffineTransformMakeScale(factor, factor);
The view will be scaled, keeping the center position on the screen, and its frame after my changes will be, for example, (34, -8,251,376), since you can see that X and Y are now different from 0.
If I use the same function on a CGRect with a frame (0,0,320,480):
CGAffineTransform t = CGAffineTransformMakeScale(factor,factor); CGRect rect2 = CGRectApplyAffineTransform(rect,t);
rect2 will save 0 for X and Y, and I will end up with something like (0,0,251,376)
Why are X and Y for rect2 not changing, as in the UIView example?
source share