title: Drawing on uiimageview is resizes uiimage?
body: <p>I'm trying to add a drawing functionality using touch events on my <code>UIImage</code> (inside a <code>UIImageView</code>). However, for certain images, when I begin drawing, the image starts shrinking and becomes blurier the more i draw on it. I mostly used ray wenderlich's old drawing tutorial for reference, just changed values to match my UI. The two images show you what happens when i draw:</p>
  
  <p><img src="https://i.stack.imgur.com/WXQf4.jpg" alt="Before drawing"></p>
  
  <p><img src="https://i.stack.imgur.com/XHQeR.png" alt="After"></p>
  
  <p>It looks like I'm using pretty standard methods for the drawing. My hunch is that the bounds/rectangle drawing methods are causing some sort of problem.</p>
  
  <pre><code>- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event {
      if(_allowDoodling == NO) return;
      UITouch *touch = [touches anyObject];
      lastPoint = [touch previousLocationInView:self.imageView];
  
  }
  
  - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
      if(_allowDoodling == NO) return;
  
      UITouch *touch = [touches anyObject];
      CGPoint currentPoint = [touch locationInView:self.imageView];
  
      UIGraphicsBeginImageContextWithOptions(_imageView.frame.size, NO, 2.0f);
      CGContextRef context = UIGraphicsGetCurrentContext();
  
      CGContextSetInterpolationQuality(context, kCGInterpolationHigh);
      [_imageView.image drawInRect:_imageView.bounds];
  
      CGContextMoveToPoint(UIGraphicsGetCurrentContext(), lastPoint.x, lastPoint.y);
      CGContextAddLineToPoint(context, currentPoint.x, currentPoint.y);
      CGContextSetLineCap(context, kCGLineCapRound);
      CGContextSetLineWidth(context, 5.0);
      CGContextSetStrokeColorWithColor(context, _doodleColor.CGColor);
  
      CGContextStrokePath(UIGraphicsGetCurrentContext());
      _imageView.image = UIGraphicsGetImageFromCurrentImageContext();
      UIGraphicsEndImageContext();
  
      lastPoint = currentPoint;
  }
  
  - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
      if(_allowDoodling == NO) return;
  
      UIGraphicsBeginImageContextWithOptions(_imageView.frame.size, NO, 2.0f);
      [_imageView.image drawInRect:_imageView.bounds];
      _imageView.image = UIGraphicsGetImageFromCurrentImageContext();
      CGContextFlush(UIGraphicsGetCurrentContext());
      UIGraphicsEndImageContext();
  }
  </code></pre>