< prev index next >

src/java.desktop/macosx/native/libsplashscreen/splashscreen_sys.m

Print this page

        

*** 157,177 **** NSRange range = [fileName rangeOfString: @"." options:NSBackwardsSearch]; NSUInteger dotIndex = range.location; NSString *fileName2x = nil; ! if (dotIndex == NSNotFound) { ! fileName2x = [fileName stringByAppendingString: @"@2x"]; ! } else { ! fileName2x = [fileName substringToIndex: dotIndex]; ! fileName2x = [fileName2x stringByAppendingString: @"@2x"]; ! fileName2x = [fileName2x stringByAppendingString: ! [fileName substringFromIndex: dotIndex]]; } ! ! if ((fileName2x != nil) && (jar || [[NSFileManager defaultManager] ! fileExistsAtPath: fileName2x])){ if (strlen([fileName2x UTF8String]) > scaledImageLength) { [pool drain]; return JNI_FALSE; } *scaleFactor = 2; --- 157,173 ---- NSRange range = [fileName rangeOfString: @"." options:NSBackwardsSearch]; NSUInteger dotIndex = range.location; NSString *fileName2x = nil; ! fileName2x = findScaledImageName(fileName, dotIndex, @"@2x"); ! if(![[NSFileManager defaultManager] ! fileExistsAtPath: fileName2x]) { ! fileName2x = findScaledImageName(fileName, dotIndex, @"@200pct"); } ! if (jar || [[NSFileManager defaultManager] ! fileExistsAtPath: fileName2x]){ if (strlen([fileName2x UTF8String]) > scaledImageLength) { [pool drain]; return JNI_FALSE; } *scaleFactor = 2;
*** 456,460 **** --- 452,469 ---- void SplashReconfigure(Splash * splash) { sendctl(splash, SPLASHCTL_RECONFIGURE); } + NSString* findScaledImageName(NSString *fileName, NSUInteger dotIndex, NSString *strToAppend) { + NSString *fileName2x = nil; + if (dotIndex == NSNotFound) { + fileName2x = [fileName stringByAppendingString: strToAppend]; + } else { + fileName2x = [fileName substringToIndex: dotIndex]; + fileName2x = [fileName2x stringByAppendingString: strToAppend]; + fileName2x = [fileName2x stringByAppendingString: + [fileName substringFromIndex: dotIndex]]; + } + return fileName2x; + } +
< prev index next >