想判断现在旋转是否是M_PI_2,应该如何比较?
赋值的时候可以 toolView.transform = CGAffineTransformMakeRotation(-M_PI_2);
但是如果这样判断就会报错。
闭关修行中......
The transform type of UIView is CGAffineTransform, which is a struct. C language does not allow direct operations on struct. You have to compare the attributes in the struct.
CG_EXTERN bool CGAffineTransformEqualToTransform(CGAffineTransform t1, CGAffineTransform t2) CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0); 用这个比较
If you buy me some fruit tomorrow, I will tell you how to calculate the rotation angle and scaling of the affine matrix
The transform type of UIView is CGAffineTransform, which is a struct.
C language does not allow direct operations on struct. You have to compare the attributes in the struct.
CG_EXTERN bool CGAffineTransformEqualToTransform(CGAffineTransform t1,
CGAffineTransform t2) CG_AVAILABLE_STARTING(__MAC_10_4, __IPHONE_2_0);
用这个比较
If you buy me some fruit tomorrow, I will tell you how to calculate the rotation angle and scaling of the affine matrix