Skip to content

Commit

Permalink
Normalize image scale
Browse files Browse the repository at this point in the history
  • Loading branch information
lauraskelton committed Jun 8, 2015
1 parent 19d66f0 commit aea101c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions jot/JotDrawView.m
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ - (UIImage *)drawOnImage:(UIImage *)image

- (UIImage *)drawAllPathsImageWithSize:(CGSize)size backgroundImage:(UIImage *)backgroundImage
{
CGFloat scale = 2.f * (size.width / CGRectGetWidth(self.bounds));
CGFloat scale = size.width / CGRectGetWidth(self.bounds);

UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, scale);

Expand All @@ -228,7 +228,9 @@ - (UIImage *)drawAllPathsImageWithSize:(CGSize)size backgroundImage:(UIImage *)b

UIImage *drawnImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return drawnImage;
return [UIImage imageWithCGImage:drawnImage.CGImage
scale:1.f
orientation:drawnImage.imageOrientation];
}

- (void)drawAllPaths
Expand Down
6 changes: 4 additions & 2 deletions jot/JotTextView.m
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ - (UIImage *)drawTextOnImage:(UIImage *)image

- (UIImage *)drawTextImageWithSize:(CGSize)size backgroundImage:(UIImage *)backgroundImage
{
CGFloat scale = 2.f * (size.width / CGRectGetWidth(self.bounds));
CGFloat scale = size.width / CGRectGetWidth(self.bounds);

UIGraphicsBeginImageContextWithOptions(self.bounds.size, NO, scale);

Expand All @@ -342,7 +342,9 @@ - (UIImage *)drawTextImageWithSize:(CGSize)size backgroundImage:(UIImage *)backg

UIImage *drawnImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return drawnImage;
return [UIImage imageWithCGImage:drawnImage.CGImage
scale:1.f
orientation:drawnImage.imageOrientation];
}

@end

0 comments on commit aea101c

Please sign in to comment.