2014-02-24 26 views
0

我正在为ios绘制一个简单的绘图应用程序。线条连接似乎不适用于钻石的顶部(北部)点。IOS石英二维线连接和钻石形状

Example

下面是代码:

CGContextRef context = UIGraphicsGetCurrentContext(); 
CGContextSetLineWidth(context, _currentSize); 
CGContextSetStrokeColorWithColor(context, _currentColor.CGColor); 
CGContextSetLineJoin(context, kCGLineJoinRound); 

CGContextMoveToPoint(context, _firstTouch.x, _firstTouch.y); 
CGContextAddLineToPoint(context, _firstTouch.x + delta, _firstTouch.y + delta); 
CGContextAddLineToPoint(context, _firstTouch.x, _firstTouch.y + (2*delta)); 
CGContextAddLineToPoint(context, _firstTouch.x - delta, _firstTouch.y + delta); 
CGContextAddLineToPoint(context, _firstTouch.x, _firstTouch.y); 
CGContextDrawPath(context, kCGPathFillStroke); 

delta简单地表示各边的长度。

的LineJoin物业正在竭尽全力点除了北角(所在的路径开始和结束。

任何指导,将不胜感激。

回答