title: CGContextStrokeRect is drawing only a side of rect
body: <p>I need to draw a rect filled with color and its border...
  the rect is filled with color properly but the outside border is partially drawn, just the right side of the rect is drawn!</p>
  
  <p>The generated UIImage is going to be used in a UITableViewCell's imageView.</p>
  
  <pre><code>- (UIImage *)legendItemWithColor:(UIColor *)color
  {
      UIGraphicsBeginImageContext(self.view.frame.size);
      CGContextRef context = UIGraphicsGetCurrentContext();
  
      CGRect outside = CGRectMake(128, 128, 128, 128);
      CGRect legend = CGRectInset(outside, 1, 1);
  
      NSLog(@"Outside: %@", NSStringFromCGRect(outside));
      NSLog(@"Legend: %@", NSStringFromCGRect(legend));
  
      CGContextSetFillColorWithColor(context, color.CGColor);
      CGContextFillRect(context, legend);
  
      CGContextSetStrokeColorWithColor(context, [UIColor blackColor].CGColor);
      CGContextStrokeRect(context, outside);
  
      UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
      UIGraphicsPopContext();
  
      return img;
  }
  </code></pre>