From 7f22152f27de4213c74d89801d676a3ac7c70a06 Mon Sep 17 00:00:00 2001 From: "pengfei.zhou" Date: Wed, 20 Nov 2019 11:10:03 +0800 Subject: [PATCH] feat:fix iOS render sync clip corner cannot be applied --- iOS/Pod/Classes/Shader/DoricViewNode.m | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/iOS/Pod/Classes/Shader/DoricViewNode.m b/iOS/Pod/Classes/Shader/DoricViewNode.m index 6731c663..a978736a 100644 --- a/iOS/Pod/Classes/Shader/DoricViewNode.m +++ b/iOS/Pod/Classes/Shader/DoricViewNode.m @@ -147,20 +147,21 @@ - (void)blendView:(UIView *)view forPropName:(NSString *)name propValue:(id)prop CGFloat rightTop = [(NSNumber *) dic[@"rightTop"] floatValue]; CGFloat rightBottom = [(NSNumber *) dic[@"rightBottom"] floatValue]; CGFloat leftBottom = [(NSNumber *) dic[@"leftBottom"] floatValue]; - CALayer *mask = nil; if (ABS(leftTop - rightTop) > CGFLOAT_MIN || ABS(leftTop - rightBottom) > CGFLOAT_MIN || ABS(leftTop - leftBottom) > CGFLOAT_MIN) { view.layer.cornerRadius = 0; - CAShapeLayer *shapeLayer = [CAShapeLayer layer]; - CGPathRef path = DoricCreateRoundedRectPath(self.view.bounds, leftTop, rightTop, rightBottom, leftBottom); - shapeLayer.path = path; - CGPathRelease(path); - mask = shapeLayer; + dispatch_async(dispatch_get_main_queue(), ^{ + CAShapeLayer *shapeLayer = [CAShapeLayer layer]; + CGPathRef path = DoricCreateRoundedRectPath(self.view.bounds, leftTop, rightTop, rightBottom, leftBottom); + shapeLayer.path = path; + CGPathRelease(path); + view.layer.mask = shapeLayer; + }); } else { view.layer.cornerRadius = leftTop; + view.layer.mask = nil; } - view.layer.mask = mask; } } else if ([name isEqualToString:@"shadow"]) { NSDictionary *dic = prop;