apply common stroke processor to elements

apply common stroke processor to elements
This commit is contained in:
Horcrux
2016-01-23 16:50:11 +08:00
parent 1fecd0a015
commit af0995022d
14 changed files with 108 additions and 56 deletions

View File

@@ -3,7 +3,7 @@ import React, {
PropTypes
} from 'react-native';
import Ellipse from './Ellipse';
import strokeFilter from '../lib/strokeFilter';
let propType = PropTypes.oneOfType([PropTypes.string, PropTypes.number]);
class Circle extends Component{
static displayName = 'Circle';
@@ -12,9 +12,15 @@ class Circle extends Component{
cy: propType,
r: propType
};
static defaultProps = {
cx: 0,
ct: 0
};
render() {
return <Ellipse
{...this.props}
{...strokeFilter(this.props)}
r={null}
rx={this.props.r}
ry={this.props.r}