Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/amazon-s3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 移动层后在CAShapeLayer.path上使用CGPathContainsPoint_Objective C_Cgpath_Cashapelayer - Fatal编程技术网

Objective c 移动层后在CAShapeLayer.path上使用CGPathContainsPoint

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

使用CGPathContainsPoint时,我的结果与CAShapeLayer的原始位置一致,但与当前位置不一致。这是正常的吗?我需要在我正在测试的CGPoint上应用转换,还是应该在代码的其他地方寻找问题?我的CAShapeLayer只是通过一次更新其.position属性来移动


为了完整起见,我添加了我的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年后救我)