add ClipPath element support

This commit is contained in:
Horcrux
2016-04-21 17:55:18 +08:00
parent 7859813eac
commit 7d3ef84163
14 changed files with 197 additions and 60 deletions
+4 -5
View File
@@ -9,13 +9,12 @@ class Polygon extends Component{
static propTypes = {
points: PropTypes.oneOfType([PropTypes.string, PropTypes.number])
};
static getPath = props => (`M${props.points.trim().replace(/\s+/g, 'L')}z`);
render() {
let props = this.props;
let d = 'M' + props.points.trim().replace(/\s+/g, 'L') + 'z';
return <Path
{...props}
points={null}
d={d}
{...this.props}
d={Polygon.getPath(this.props)}
/>;
}
}