title: Why does a CAShapeLayer's stroke extend out of the frame?
body: <p>Here's sample code:</p>
  
  <pre><code>//Called by VC:
  
  HICircleView *circleView = [[HICircleView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
  
  // init of circle view
  
  - (id)initWithFrame:(CGRect)frame
  {
      self = [super initWithFrame:frame];
      if (self) {
          CAShapeLayer *borderLayer = [CAShapeLayer layer];
          borderLayer.fillColor = [UIColor whiteColor].CGColor;
          borderLayer.path = [UIBezierPath bezierPathWithOvalInRect:self.frame].CGPath;
          borderLayer.strokeColor = [[UIColor redColor] CGColor];
          borderLayer.lineWidth = 5;
          [self.layer addSublayer:borderLayer];
      }
      return self;
  }
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/OS6ni.png" alt="enter image description here"></p>
  
  <p>OK, thanks for the answer. to shift i:</p>
  
  <pre><code>CGRect rect = CGRectMake(3, 3, self.frame.size.width, self.frame.size.height);
  borderLayer.path = [UIBezierPath bezierPathWithOvalInRect:rect].CGPath;
  </code></pre>
  
  <p>And made 6 the line width.</p>