Add examples and refactor code

Add examples and refactor code
This commit is contained in:
Horcrux
2016-01-21 23:44:38 +08:00
parent 89b52fd4a2
commit a482948b83
61 changed files with 3143 additions and 105 deletions
+25
View File
@@ -0,0 +1,25 @@
import React, {
Component,
PropTypes,
ART
} from 'react-native';
import fillFilter from '../lib/fillFilter';
import strokeFilter from '../lib/strokeFilter';
import Path from './Path';
class Polygon extends Component{
static displayName = 'Polygon';
static propTypes = {
points: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired
};
render() {
let props = this.props;
let d = 'M' + props.points.trim().replace(/\s+/g, 'L') + 'z';
return <Path
{...props}
points={null}
d={d}
/>;
}
}
export default Polygon;