How to Get the reverse path of a UIBezierPath

后端 未结 4 1486
花落未央
花落未央 2021-02-07 14:56
self.myPath=[UIBezierPath bezierPathWithArcCenter:center 
                                           radius:200 
                                       startAngle:0 
            


        
4条回答
  •  半阙折子戏
    2021-02-07 15:11

    Use bezierPathByReversingPath. From the docs (iOS 6.0+ only):

    Creates and returns a new bezier path object with the reversed contents of the current path.

    so to reverse your path, you'd just:

    UIBezierPath* aPath = [UIBezierPath bezierPathWithArcCenter:center
                                                         radius:200
                                                     startAngle:0
                                                       endAngle:180
                                                      clockwise:YES];
    self.myPath = [aPath bezierPathByReversingPath];
    

提交回复
热议问题