feat:fix iOS render sync clip corner cannot be applied

This commit is contained in:
pengfei.zhou 2019-11-20 11:10:03 +08:00
parent 5745972f1e
commit 7f22152f27

View File

@ -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;