You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@weex.apache.org by GitBox <gi...@apache.org> on 2018/09/19 09:47:32 UTC

[GitHub] cxfeng1 closed pull request #1533: [WEEX-616][iOS] scroller support borderRadius

cxfeng1 closed pull request #1533: [WEEX-616][iOS] scroller support borderRadius
URL: https://github.com/apache/incubator-weex/pull/1533
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
index f5719ab5ee..9405e0dcc2 100644
--- a/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
+++ b/ios/sdk/WeexSDK/Sources/Component/WXComponent_internal.h
@@ -45,6 +45,7 @@ typedef id (^WXDataBindingBlock)(NSDictionary *data, BOOL *needUpdate);
      */
     UIColor *_backgroundColor;
     NSString *_backgroundImage;
+    NSString *_clipRadius;
     WXClipType _clipToBounds;
     UIView *_view;
     CGFloat _opacity;
diff --git a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m
index d5d63b78f5..6190836ae4 100644
--- a/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m
+++ b/ios/sdk/WeexSDK/Sources/Display/WXComponent+Display.m
@@ -411,6 +411,15 @@ - (void)_drawBorderWithContext:(CGContextRef)context size:(CGSize)size
     }
     
     CGContextStrokePath(context);
+    
+    //clipRadius is beta feature
+    //TO DO: remove _clipRadius property
+    if (_clipToBounds && _clipRadius) {
+        BOOL radiusEqual = _borderTopLeftRadius == _borderTopRightRadius && _borderTopRightRadius == _borderBottomRightRadius && _borderBottomRightRadius == _borderBottomLeftRadius;
+        if (!radiusEqual) {
+            self.layer.mask = [self drawBorderRadiusMaskLayer:rect];
+        }
+    }
 }
 
 - (BOOL)_needsDrawBorder
diff --git a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
index 7883cce317..4e87383489 100644
--- a/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
+++ b/ios/sdk/WeexSDK/Sources/Model/WXComponent.mm
@@ -146,6 +146,12 @@ - (instancetype)initWithRef:(NSString *)ref
             _testId = [WXConvert NSString:attributes[@"testId"]];
         }
         
+        //may be removed when this feature is stable
+        if (attributes[@"clipRadius"])
+        {
+            _clipRadius = [WXConvert NSString:attributes[@"clipRadius"]];
+        }
+        
 #ifdef DEBUG
         WXLogDebug(@"flexLayout -> init component: ref : %@ , styles: %@",ref,styles);
         WXLogDebug(@"flexLayout -> init component: ref : %@ , attributes: %@",ref,attributes);


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services