How to use CGAffineTransformMakeRotation?

前端 未结 2 1360
失恋的感觉
失恋的感觉 2020-11-30 04:44

\"enter

I want to draw text use Quartz 2D. The \"menu\" direction is wrong. I want \"M

相关标签:
2条回答
  • 2020-11-30 05:24
    [view setTransform:CGAffineTransformMakeRotation(M_PI / 2)];
    
    0 讨论(0)
  • 2020-11-30 05:35

    CGAffineTransformMakeRotation expects angle in radians, not in degrees.

    #define DEGREES_TO_RADIANS(x) (M_PI * (x) / 180.0)
    ...
    
    CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(45));
    
    0 讨论(0)
提交回复
热议问题