Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
Include screen scale factor on the simulator, as cache is shared.
Browse files Browse the repository at this point in the history
  • Loading branch information
alloy committed Oct 11, 2012
1 parent 5d4338c commit 6c76cce
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/FTPDFIconRenderer.m
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,12 @@ - (NSString *)cachePathWithIdentifier:(NSString *)identifier;
NSStringFromCGSize(self.targetSize),
self.sourcePageIndex,
identifier ?: @""];
#if TARGET_IPHONE_SIMULATOR
// On the simulator, the cache dir is shared between retina and non-retina
// devices, so include the device's main screen scale factor to ensure the
// right dimensions are used per device.
cachePath = [NSString stringWithFormat:@"%@-%f", cachePath, [[UIScreen mainScreen] scale]];
#endif
cachePath = FTPDFMD5String(cachePath);
cachePath = [[[self class] cacheDirectory] stringByAppendingPathComponent:cachePath];
cachePath = [cachePath stringByAppendingPathExtension:@"png"];
Expand Down

0 comments on commit 6c76cce

Please sign in to comment.