You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by cx...@apache.org on 2017/03/27 13:25:30 UTC

[3/6] incubator-weex git commit: * [ios] bug fix : add init to init

* [ios] bug fix : add init to init


Project: http://git-wip-us.apache.org/repos/asf/incubator-weex/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-weex/commit/b31abe87
Tree: http://git-wip-us.apache.org/repos/asf/incubator-weex/tree/b31abe87
Diff: http://git-wip-us.apache.org/repos/asf/incubator-weex/diff/b31abe87

Branch: refs/heads/0.11-dev
Commit: b31abe8701f46e52e44aebede51081ade962e1b6
Parents: 9ab9c77
Author: kfeagle <su...@163.com>
Authored: Mon Mar 27 19:06:17 2017 +0800
Committer: kfeagle <su...@163.com>
Committed: Mon Mar 27 19:06:17 2017 +0800

----------------------------------------------------------------------
 .../Sources/Display/WXComponent+BoxShadow.m     |  4 ----
 ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m   | 20 +++++++++++++++-----
 2 files changed, 15 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b31abe87/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
index 6c75050..ba9927b 100644
--- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
@@ -18,10 +18,6 @@
 - (WXBoxShadow *_Nullable)getViewBoxShadow:(UIView *_Nullable)view
 {
     WXBoxShadow *boxShadow = [WXBoxShadow new];
-    boxShadow.shadowColor = [UIColor whiteColor].CGColor;
-    boxShadow.shadowRadius = 0.0f;
-    boxShadow.isInset = NO;
-    boxShadow.shadowOffset = CGSizeZero;
     boxShadow.shadowColor = view.layer.shadowColor;
     boxShadow.shadowOffset = view.layer.shadowOffset;
     boxShadow.shadowRadius = view.layer.shadowRadius;

http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/b31abe87/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
index 48687ce..aae9f81 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
@@ -12,6 +12,21 @@
 
 @implementation WXBoxShadow
 
+- (instancetype)init
+{
+    self = [super init];
+    
+    if (self) {
+        self.shadowColor = [UIColor whiteColor].CGColor;
+        self.shadowRadius = 0.0f;
+        self.isInset = NO;
+        self.shadowOffset = CGSizeZero;
+        self.shadowOpacity = 1.0f;
+    }
+    
+    return self;
+}
+
 + (NSArray *)getBoxShadowElementsByBlank:(NSString *)string
 {
     string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];
@@ -34,11 +49,6 @@
         return nil;
     }
     WXBoxShadow *boxShadow = [WXBoxShadow new];
-    boxShadow.shadowColor = [UIColor whiteColor].CGColor;
-    boxShadow.shadowRadius = 0.0f;
-    boxShadow.isInset = NO;
-    boxShadow.shadowOffset = CGSizeZero;
-    boxShadow.shadowOpacity = 1.0f;
     
     //parse color
     if ([string rangeOfString:@"rgb"].location != NSNotFound) {