You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@weex.apache.org by ac...@apache.org on 2017/05/23 06:32:11 UTC

[03/10] incubator-weex git commit: + [ios] boader reset

+ [ios] boader reset


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

Branch: refs/heads/0.13-dev
Commit: ae7ca8de5249d9bb15f8a061261aa3e68272f4a0
Parents: 36cd101
Author: 齐山 <su...@163.com>
Authored: Mon May 22 12:13:02 2017 +0800
Committer: 齐山 <su...@163.com>
Committed: Mon May 22 12:13:02 2017 +0800

----------------------------------------------------------------------
 .../Sources/View/WXComponent+ViewManagement.m   | 29 ++++++++++++++------
 1 file changed, 21 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-weex/blob/ae7ca8de/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
----------------------------------------------------------------------
diff --git a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
index c084a52..125b491 100644
--- a/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
+++ b/ios/sdk/WeexSDK/Sources/View/WXComponent+ViewManagement.m
@@ -198,6 +198,22 @@
     }
 }
 
+#define WX_BOARD_RADIUS_RESET_ALL(key)\
+do {\
+    if (styles && [styles containsObject:@#key]) {\
+        _borderTopLeftRadius = _borderTopRightRadius = _borderBottomLeftRadius = _borderBottomRightRadius = 0;\
+        [self setNeedsLayout];\
+    }\
+} while(0);
+
+#define WX_BOARD_RADIUS_RESET(key)\
+do {\
+if (styles && [styles containsObject:@#key]) {\
+    _##key = 0;\
+    [self setNeedsLayout];\
+    }\
+} while(0);
+
 -(void)_resetStyles:(NSArray *)styles
 {
     if (styles && [styles containsObject:@"backgroundColor"]) {
@@ -209,14 +225,11 @@
         _boxShadow = nil;
         [self setNeedsDisplay];
     }
-    if (styles && [styles containsObject:@"borderRadius"]) {
-        //reset
-        _borderTopStyle = _borderRightStyle = _borderBottomStyle = _borderLeftStyle = WXBorderStyleSolid;
-        _borderTopColor = _borderLeftColor = _borderRightColor = _borderBottomColor = [UIColor blackColor];
-        _borderTopWidth = _borderLeftWidth = _borderRightWidth = _borderBottomWidth = 0;
-        _borderTopLeftRadius = _borderTopRightRadius = _borderBottomLeftRadius = _borderBottomRightRadius = 0;
-        [self setNeedsDisplay];
-    }
+    WX_BOARD_RADIUS_RESET_ALL(borderRadius);
+    WX_BOARD_RADIUS_RESET(borderTopLeftRadius);
+    WX_BOARD_RADIUS_RESET(borderTopRightRadius);
+    WX_BOARD_RADIUS_RESET(borderBottomLeftRadius);
+    WX_BOARD_RADIUS_RESET(borderBottomRightRadius);
 }
 
 - (void)_unloadViewWithReusing:(BOOL)isReusing