From 895006e2139cda492033879692323b4b329b9271 Mon Sep 17 00:00:00 2001 From: "Jay Freeman (saurik)" Date: Thu, 20 Oct 2011 03:13:29 +0000 Subject: [PATCH] Support @2x.png if @2x~iphone.png. --- Library.mm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library.mm b/Library.mm index e97e739..505851f 100644 --- a/Library.mm +++ b/Library.mm @@ -237,9 +237,6 @@ static unsigned $getScale$(NSString *path) { } static NSArray *$useScale$(NSArray *files, bool use = true) { - if (!use) - return files; - if (Scale_ == 0) { UIScreen *screen([UIScreen mainScreen]); if ([screen respondsToSelector:@selector(scale)]) @@ -254,7 +251,10 @@ static NSArray *$useScale$(NSArray *files, bool use = true) { NSMutableArray *scaled([NSMutableArray arrayWithCapacity:([files count] * 2)]); for (NSString *file in files) { - [scaled addObject:[NSString stringWithFormat:@"%@@2x.%@", [file stringByDeletingPathExtension], [file pathExtension]]]; + if (use && Scale_ == 2) + [scaled addObject:[NSString stringWithFormat:@"%@@2x.%@", [file stringByDeletingPathExtension], [file pathExtension]]]; + if ([file hasSuffix:@"@2x~iphone.png"]) + [scaled addObject:[[file substringWithRange:NSMakeRange(0, [file length] - 11)] stringByAppendingPathExtension:@"png"]]; [scaled addObject:file]; } -- 2.47.2