Skip to content

Commit

Permalink
Fix for IOS-44, where screenshots appear too small on Retina display …
Browse files Browse the repository at this point in the history
…devices.
  • Loading branch information
wooster committed Jun 3, 2012
1 parent eb605b0 commit 7a0d877
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ - (id)initWithImage:(UIImage *)image {
imageView = [[UIImageView alloc] initWithImage:image];
self.frame = imageView.bounds;
[self addSubview:imageView];
self.contentSize = imageView.bounds.size;
self.contentSize = imageView.bounds.size;
}
return self;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ - (void)setupScrollView {
CGFloat xScale = boundsSize.width / imageSize.width;
CGFloat yScale = boundsSize.height / imageSize.height;
CGFloat minScale = MIN(xScale, yScale);
CGFloat maxScale = 1.0 / [[UIScreen mainScreen] scale];
CGFloat maxScale = 2.0;

if (minScale > maxScale) {
minScale = maxScale;
Expand Down
7 changes: 4 additions & 3 deletions ApptentiveConnect/source/Misc/ATUtilities.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ + (UIImage*)imageByTakingScreenshot {
// On iOS 4 and later, use UIGraphicsBeginImageContextWithOptions to take the scale into consideration
// On iOS prior to 4, fall back to use UIGraphicsBeginImageContext
CGSize imageSize = [[UIScreen mainScreen] bounds].size;
if (NULL != UIGraphicsBeginImageContextWithOptions)
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0);
else
if (NULL != UIGraphicsBeginImageContextWithOptions) {
UIGraphicsBeginImageContextWithOptions(imageSize, NO, 0.0);
} else {
UIGraphicsBeginImageContext(imageSize);
}

CGContextRef context = UIGraphicsGetCurrentContext();

Expand Down

0 comments on commit 7a0d877

Please sign in to comment.