【发布时间】:2012-03-09 10:34:34
【问题描述】:
如何获得 CALayer 中 CGPoint 的绝对位置。我需要这个来绘制精确的像素
编辑:绝对屏幕
【问题讨论】:
-
你所说的“绝对”是什么意思?..相对于最顶层,同一层的像素数,...
标签: iphone objective-c calayer quartz-graphics
如何获得 CALayer 中 CGPoint 的绝对位置。我需要这个来绘制精确的像素
编辑:绝对屏幕
【问题讨论】:
标签: iphone objective-c calayer quartz-graphics
递归地测试超级层,直到到达根层:
CGPoint originalPoint = // wherever from you obtain your original point
CALayer *layer = self;
CGPoint point = originalPoint;
while (layer.superlayer)
{
point = [layer convertPoint:point toLayer:layer.superlayer];
layer = layer.superlayer;
}
// here `point' will contain the exact position
【讨论】: