title: CGContextDrawPath Stroke disappears if Fill is added
body: <p>trying to draw circle divided to dynamically provided number of sectors. In the end my circle should look like pie.</p>
  
  <p>I've created class Circle which contains number of Pies inside. Circle has method <code>- (void)draw</code> which calles <code>[pie draw];</code> in <code>for (Pie *pie in self.pies)</code> loop.</p>
  
  <p>Implementation of pie looks like this:</p>
  
  <pre><code>- (void)draw {  
  
    CGContextRef context = UIGraphicsGetCurrentContext();
  
    float startAngleRads = degreesToRadians(_startAngle);
    float endAngleRads = degreesToRadians(_endAngle);
  
  
    CGContextBeginPath(context);
    CGContextSetLineWidth(context, 1.0f);
    CGContextSetLineCap(context, kCGLineCapRound);
    CGContextSetLineJoin(context, kCGLineJoinRound);
  
    CGColorRef strokeColor = [_strokeColor CGColor];
    CGContextSetStrokeColorWithColor(context, strokeColor);
  
    CGColorRef fillColor = [_bgColor CGColor];
    CGContextSetFillColorWithColor(context, fillColor);
  
  
    CGContextMoveToPoint(context, _x, _y);
    CGContextAddArc(context, _x, _y, _r, startAngleRads, endAngleRads, YES);
    CGContextDrawPath(context, kCGPathStroke);
  
    CGContextFlush(context);
  }
  </code></pre>
  
  <p>This draws nice circle with sectors but without any filling of course. When I change last lines to <code>CGContextDrawPath(context, kCGPathStrokeFill);</code> my stroke lines disappears and only last line (last sector) stays at the screen, other parts of circle are filled with bgcolor and no stroke is visible anymore.</p>
  
  <p>The question is: how can I draw completly separated "sectors" (every sector should look like triangle with Arc and Stroke and Fill). I need this because I want to toggle visibility of that sectors but at the moment I cant even figure out how to draw them correctly.</p>
  
  <p>If this is important, all drawing happens on the layer with <code>self.opaque = NO;</code>. </p>