SKShapeNode with UIBezierPath is not fully populated

I want to draw a filled circle sector using SKShapeNode with UIBezierPath. I work well in most cases, but with smaller angles the form does not fill out completely (there is a small gap right under the arc). Like this:

enter image description here

Here is the code I'm using:

CGPoint center = CGPointMake(500, 300) ;

UIBezierPath *bezierPath = [UIBezierPath bezierPath];
[bezierPath addArcWithCenter:center radius:400   startAngle:1.825777 endAngle:2.011118 clockwise:YES];
[bezierPath addLineToPoint:center];
[bezierPath closePath];

SKShapeNode *shapeNode = [SKShapeNode shapeNodeWithPath:bezierPath.CGPath];
shapeNode.strokeColor = [UIColor whiteColor];
shapeNode.fillColor = [UIColor whiteColor];
[self addChild:shapeNode];

The result is similar to the iPad and the simulator (iOS 8.1).

Am I doing something wrong or is it some kind of limitation or mistake?

If you cannot draw this shape more accurately using these APIs, could you suggest other ways to draw it in the context of the SpriteKit game.

Thanks in advance.

+4
source share
1 answer

SKShapeNode, . http://sartak.org/2014/03/skshapenode-you-are-dead-to-me.html

: SKShapeNode, .

shapeNode.lineWidth = 4

UIKit, bezierPath, drawRect.

+2

All Articles