You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/12/06 20:38:46 UTC
git commit: Handle error when splash image is missing.
Updated Branches:
refs/heads/dev 9541c1eb3 -> d799eda02
Handle error when splash image is missing.
>From pull request:
https://github.com/apache/cordova-plugin-splashscreen/pull/1
Project: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/commit/d799eda0
Tree: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/tree/d799eda0
Diff: http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/diff/d799eda0
Branch: refs/heads/dev
Commit: d799eda0204f4fee7a8ca8b9ba9c844b69a9d56a
Parents: 9541c1e
Author: Nathan Peles <na...@nathanpeles.com>
Authored: Fri Dec 6 14:38:01 2013 -0500
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Fri Dec 6 14:38:28 2013 -0500
----------------------------------------------------------------------
src/ios/CDVSplashScreen.m | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cordova-plugin-splashscreen/blob/d799eda0/src/ios/CDVSplashScreen.m
----------------------------------------------------------------------
diff --git a/src/ios/CDVSplashScreen.m b/src/ios/CDVSplashScreen.m
index a1c11c3..bba7deb 100644
--- a/src/ios/CDVSplashScreen.m
+++ b/src/ios/CDVSplashScreen.m
@@ -163,7 +163,7 @@
- (void)updateBounds
{
UIImage* img = _imageView.image;
- CGRect imgBounds = CGRectMake(0, 0, img.size.width, img.size.height);
+ CGRect imgBounds = (img) ? CGRectMake(0, 0, img.size.width, img.size.height) : CGRectZero;
CGSize screenSize = [self.viewController.view convertRect:[UIScreen mainScreen].bounds fromView:nil].size;
@@ -172,8 +172,8 @@
CGRect statusFrame = [self.viewController.view convertRect:[UIApplication sharedApplication].statusBarFrame fromView:nil];
if (!(IsAtLeastiOSVersion(@"7.0"))) {
imgBounds.origin.y -= statusFrame.size.height;
- }
- } else {
+ }
+ } else if (imgBounds.size.width > 0) {
CGRect viewBounds = self.viewController.view.bounds;
CGFloat imgAspect = imgBounds.size.width / imgBounds.size.height;
CGFloat viewAspect = viewBounds.size.width / viewBounds.size.height;