mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-04 23:54:53 +00:00
add ClipPath element support
This commit is contained in:
+9
-8
@@ -12,21 +12,22 @@ class Ellipse extends Component{
|
||||
rx: propType,
|
||||
ry: propType
|
||||
};
|
||||
render() {
|
||||
let {props} = this;
|
||||
let {cx, cy, rx, ry} = this.props;
|
||||
let d = `
|
||||
|
||||
static getPath = props => {
|
||||
let {cx, cy, rx, ry} = props;
|
||||
return `
|
||||
M ${cx - rx} ${cy}
|
||||
a ${rx}, ${ry} 0 1, 0 ${rx * 2}, 0
|
||||
a ${rx}, ${ry} 0 1, 0 ${-rx * 2}, 0
|
||||
Z
|
||||
`;
|
||||
};
|
||||
|
||||
render() {
|
||||
let {props} = this;
|
||||
let d = Ellipse.getPath(this.props);
|
||||
return <Path
|
||||
{...props}
|
||||
cx={null}
|
||||
cy={null}
|
||||
rx={null}
|
||||
ry={null}
|
||||
d={d}
|
||||
/>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user