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:28 UTC

[1/6] incubator-weex git commit: + [ios] bug fix: boxshadow crash in setshadowcolor

Repository: incubator-weex
Updated Branches:
  refs/heads/0.11-dev 4c91655f1 -> 20ee5866d


+ [ios] bug fix: boxshadow crash in setshadowcolor


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

Branch: refs/heads/0.11-dev
Commit: 9666cffa5eee4336c304443632d87070916cafb5
Parents: 5cb0819
Author: \u9f50\u5c71 <su...@163.com>
Authored: Mon Mar 27 18:02:17 2017 +0800
Committer: kfeagle <su...@163.com>
Committed: Mon Mar 27 18:02:17 2017 +0800

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


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9666cffa/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 ba9927b..6c75050 100644
--- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+BoxShadow.m
@@ -18,6 +18,10 @@
 - (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/9666cffa/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 5422747..6701c28 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
@@ -34,6 +34,10 @@
         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
@@ -43,13 +47,19 @@
         if (begin.location < end.location && end.location < [string length]) {
             NSRange range = NSMakeRange(begin.location, end.location-begin.location + 1);
             NSString *str = [string substringWithRange:range];
-            boxShadow.shadowColor = [WXConvert UIColor:str].CGColor;
+            UIColor * color = [WXConvert UIColor:str];
+            if (color && [color isKindOfClass:[UIColor class]]) {
+                boxShadow.shadowColor = color.CGColor;
+            }
             string = [string stringByReplacingOccurrencesOfString:str withString:@""];// remove color string
         }
     } else {
         NSArray *boxShadowElements = [self getBoxShadowElementsByBlank:string];
         NSString *str = [boxShadowElements lastObject];
-        boxShadow.shadowColor = [WXConvert UIColor:str].CGColor;
+        UIColor * color = [WXConvert UIColor:str];
+        if (color && [color isKindOfClass:[UIColor class]]) {
+            boxShadow.shadowColor = color.CGColor;
+        }
         string = [string stringByReplacingOccurrencesOfString:str withString:@""];// remove color string
     }
 


[6/6] incubator-weex git commit: Merge branch '0.11-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.11-dev

Posted by cx...@apache.org.
Merge branch '0.11-dev' of https://git-wip-us.apache.org/repos/asf/incubator-weex into 0.11-dev


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

Branch: refs/heads/0.11-dev
Commit: 20ee5866db7d7e3e7c0d00ca027e4c9d6f4b7d70
Parents: 665a64e 4c91655
Author: cxfeng <cx...@apache.org>
Authored: Mon Mar 27 21:25:08 2017 +0800
Committer: cxfeng <cx...@apache.org>
Committed: Mon Mar 27 21:25:08 2017 +0800

----------------------------------------------------------------------
 .../bundlejs/vue/components/waterfall.js        | 873 +++++++++++++++++++
 1 file changed, 873 insertions(+)
----------------------------------------------------------------------



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

Posted by cx...@apache.org.
* [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) {


[5/6] incubator-weex git commit: * [ios] delete blank line

Posted by cx...@apache.org.
* [ios] delete blank line


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

Branch: refs/heads/0.11-dev
Commit: 665a64e4319e970c03912ec2ffd52ae6dd56e2bc
Parents: 3492773
Author: kfeagle <su...@163.com>
Authored: Mon Mar 27 21:21:21 2017 +0800
Committer: kfeagle <su...@163.com>
Committed: Mon Mar 27 21:21:21 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m | 2 --
 1 file changed, 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/665a64e4/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 5c6bf4a..8df636c 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
@@ -31,7 +31,6 @@
     return self;
 }
 
-
 - (void)setShadowColor: (CGColorRef)shadowColor
 {
     if (shadowColor == _shadowColor)
@@ -42,7 +41,6 @@
     _shadowColor = shadowColor;
 }
 
-
 + (NSArray *)getBoxShadowElementsByBlank:(NSString *)string
 {
     string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];


[4/6] incubator-weex git commit: * [ios] bug fix: box shadow release refer to https://github.com/gnustep/quartzcore/blob/master/Source/CALayer.m

Posted by cx...@apache.org.
* [ios] bug fix: box shadow  release  refer to https://github.com/gnustep/quartzcore/blob/master/Source/CALayer.m


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

Branch: refs/heads/0.11-dev
Commit: 3492773263ca93c49bc3807556078407f2f1dc23
Parents: b31abe8
Author: kfeagle <su...@163.com>
Authored: Mon Mar 27 20:57:59 2017 +0800
Committer: kfeagle <su...@163.com>
Committed: Mon Mar 27 20:57:59 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m | 18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/34927732/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 aae9f81..5c6bf4a 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
@@ -12,12 +12,16 @@
 
 @implementation WXBoxShadow
 
+- (void) dealloc
+{
+    CGColorRelease(_shadowColor);
+}
+
 - (instancetype)init
 {
     self = [super init];
     
     if (self) {
-        self.shadowColor = [UIColor whiteColor].CGColor;
         self.shadowRadius = 0.0f;
         self.isInset = NO;
         self.shadowOffset = CGSizeZero;
@@ -27,6 +31,18 @@
     return self;
 }
 
+
+- (void)setShadowColor: (CGColorRef)shadowColor
+{
+    if (shadowColor == _shadowColor)
+    return;
+    
+    CGColorRetain(shadowColor);
+    CGColorRelease(_shadowColor);
+    _shadowColor = shadowColor;
+}
+
+
 + (NSArray *)getBoxShadowElementsByBlank:(NSString *)string
 {
     string = [string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]];


[2/6] incubator-weex git commit: + [ios] delete blank

Posted by cx...@apache.org.
+ [ios] delete blank


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

Branch: refs/heads/0.11-dev
Commit: 9ab9c773f1a9a42fff8d35cae3313c7ac1667021
Parents: 9666cff
Author: kfeagle <su...@163.com>
Authored: Mon Mar 27 18:05:05 2017 +0800
Committer: kfeagle <su...@163.com>
Committed: Mon Mar 27 18:05:05 2017 +0800

----------------------------------------------------------------------
 ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/9ab9c773/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 6701c28..48687ce 100644
--- a/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
+++ b/ios/sdk/WeexSDK/Sources/Utility/WXBoxShadow.m
@@ -47,7 +47,7 @@
         if (begin.location < end.location && end.location < [string length]) {
             NSRange range = NSMakeRange(begin.location, end.location-begin.location + 1);
             NSString *str = [string substringWithRange:range];
-            UIColor * color = [WXConvert UIColor:str];
+            UIColor *color = [WXConvert UIColor:str];
             if (color && [color isKindOfClass:[UIColor class]]) {
                 boxShadow.shadowColor = color.CGColor;
             }
@@ -56,7 +56,7 @@
     } else {
         NSArray *boxShadowElements = [self getBoxShadowElementsByBlank:string];
         NSString *str = [boxShadowElements lastObject];
-        UIColor * color = [WXConvert UIColor:str];
+        UIColor *color = [WXConvert UIColor:str];
         if (color && [color isKindOfClass:[UIColor class]]) {
             boxShadow.shadowColor = color.CGColor;
         }