【发布时间】:2015-11-07 09:55:43
【问题描述】:
如何删除我的路径的某些部分? 我在屏幕上绘制了一条路径,现在假设我想删除 1/3:
我试着用这种方式来做(路径是我的原始路径,cPath 是复制的会被剪掉的):
let sizePath = CGPathGetBoundingBox(path).size
UIGraphicsBeginImageContext(sizePath)
let context = UIGraphicsGetCurrentContext()
let cPath = CGPathCreateMutableCopy(path)
CGContextAddPath(context, cPath)
CGContextDrawPath(context, .Stroke)
let rect = CGRectMake(currentPosition.x, 0, sizePath.width, sizePath.height)
CGContextClipToRect(context, rect)
//How to Recive here this Clipped Path from context???
UIGraphicsEndImageContext()
但我不知道如何从我的上下文中接收这条路径...
【问题讨论】: