title: CGImage rotating when i draw it on CGContext
body: <p>I have next code which is called every time user touches the screen and modifies the UIBezierPath</p>
  
  <pre><code>  CGContextRef context = UIGraphicsGetCurrentContext();
    CGContextDrawImage(context, self.bounds, image);
  
    [lineColor setStroke];
    [currentPath stroke];
    if(panEnded)
    {
      if(image!=nil)
      {
        CFRelease(image);
      }
      image=nil;
      image=CGBitmapContextCreateImage(context);
      panEnded=false;
    }
  </code></pre>
  
  <p>so every time i create new image (from "if" branch) it rotates 180 degrees. what am i doing wrong?</p>