-1
我有一個比特的碼,其試圖找出正確的邊界框爲正在旋轉-5度的矩形:CGRectApplyAffineTransform結果不正確?
CGRect rectangleToRotate = CGRectMake(0,0,104.949, 131.017);
CGAffineTransform rotateTransform = CGAffineTransformMakeRotation((M_PI * -5)/180);
CGRectApplyAffineTransform (rectangleToRotate, rotateTransform);
所產生的結果是具有尺寸的矩形:{115.968, 139.664}
其中,由於某些原因太大而不能緊緊包圍矩形。然而,當我在Adobe Illustrator中採用相同的場景時,邊界框是:{104.659, 132.143}
,這是正確的。
我在這裏錯過了什麼?
是不是360度? –
插圖大小不能正確,因爲旋轉後的矩形將始終比原始大。 –