将视图坐标映射到CALayer坐标

时间:2012-10-15 23:58:25

标签: ios xcode core-animation calayer

我有一个视图,其中包含一些(嵌套)图层,这些图层基于对拥有视图的触摸进行自定义绘图。

鉴于

  • (void)touchesBegan:(NSSet *)触及withEvent:(UIEvent *)event { UITouch * touch = [触及anyObject]; ....

我的视图是图层的委托,并将收到通过

绘制的回调
  • (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)context { ..

我需要抓住我捕获的点数&存储在touches方法中并在图层的绘图中利用它们。但是,在使用之前,视图中捕获的坐标需要转换为图层坐标系。如何做到这一点?

由于 皮特

0 个答案:

没有答案
相关问题