Objective c 移动层后在CAShapeLayer.path上使用CGPathContainsPoint
使用CGPathContainsPoint时,我的结果与CAShapeLayer的原始位置一致,但与当前位置不一致。这是正常的吗?我需要在我正在测试的CGPoint上应用转换,还是应该在代码的其他地方寻找问题?我的CAShapeLayer只是通过一次更新其.position属性来移动Objective c 移动层后在CAShapeLayer.path上使用CGPathContainsPoint,objective-c,cgpath,cashapelayer,Objective C,Cgpath,Cashapelayer,使用CGPathContainsPoint时,我的结果与CAShapeLayer的原始位置一致,但与当前位置不一致。这是正常的吗?我需要在我正在测试的CGPoint上应用转换,还是应该在代码的其他地方寻找问题?我的CAShapeLayer只是通过一次更新其.position属性来移动 为了完整起见,我添加了我的CAShapeLayer是UIButton.layer的一个子层。为了回答我自己的问题,我需要使用以下方法将接触点的位置(在UIButton的坐标空间中)转换为CAShapeLayer的坐
为了完整起见,我添加了我的CAShapeLayer是UIButton.layer的一个子层。为了回答我自己的问题,我需要使用以下方法将接触点的位置(在UIButton的坐标空间中)转换为CAShapeLayer的坐标空间:
CGPoint convertedTouchPoint = [myButton.layer convertPoint:touchPoint toLayer:myShapeLayer];
为了回答我自己的问题,我需要使用以下方法将触摸点的位置(位于UIButton的坐标空间中)转换为CAShapLayer的坐标空间:
CGPoint convertedTouchPoint = [myButton.layer convertPoint:touchPoint toLayer:myShapeLayer];
8年后救我)8年后救我)