complete ClipPath element on iOS

This commit is contained in:
Horcrux
2016-04-27 23:14:15 +08:00
parent efd56cdb6a
commit fa751e31b0
18 changed files with 112 additions and 60 deletions
+8 -2
View File
@@ -80,11 +80,16 @@ class Defs extends Component{
static Item = DefsItem;
static Use = DefsUse;
shouldRender = false;
getChildren = () => {
return Children.map(this.props.children, child => {
let {type} = child;
if (type === LinearGradient || type === RadialGradient || type === ClipPath) {
if (type === ClipPath) {
this.shouldRender = true;
}
return cloneElement(child, {
svgId: this.props.svgId
});
@@ -99,8 +104,9 @@ class Defs extends Component{
};
render() {
return <NativeGroup>
{this.getChildren()}
let children = this.getChildren();
return <NativeGroup opacity={this.shouldRender ? 1 : 0}>
{children}
</NativeGroup>;
}
}