mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-19 05:25:10 +00:00
change circle radius percentage calculation
Change circle radius percentage calculation. Add example for percentage props for shape. Remove unused document ref
This commit is contained in:
@@ -11,12 +11,12 @@ class CircleExample extends Component{
|
||||
render() {
|
||||
return <Svg
|
||||
height="100"
|
||||
width="100"
|
||||
width="140"
|
||||
>
|
||||
<Circle
|
||||
cx="50"
|
||||
cy="50"
|
||||
r="50"
|
||||
cx="50%"
|
||||
cy="50%"
|
||||
r="40%"
|
||||
fill="pink"
|
||||
/>
|
||||
</Svg>;
|
||||
|
||||
@@ -14,10 +14,10 @@ class EllipseExample extends Component{
|
||||
width="110"
|
||||
>
|
||||
<Ellipse
|
||||
cx="55"
|
||||
cy="55"
|
||||
rx="50"
|
||||
ry="30"
|
||||
cx="50%"
|
||||
cy="50%"
|
||||
rx="45%"
|
||||
ry="30%"
|
||||
stroke="purple"
|
||||
strokeWidth="2"
|
||||
fill="yellow"
|
||||
|
||||
@@ -15,10 +15,10 @@ class LineExample extends Component{
|
||||
width="100"
|
||||
>
|
||||
<Line
|
||||
x1="0"
|
||||
y1="0"
|
||||
x2="100"
|
||||
y2="100"
|
||||
x1="10%"
|
||||
y1="10%"
|
||||
x2="90%"
|
||||
y2="90%"
|
||||
stroke="red"
|
||||
strokeWidth="2"
|
||||
/>
|
||||
|
||||
@@ -14,10 +14,10 @@ class RectExample extends Component{
|
||||
height="60"
|
||||
>
|
||||
<Rect
|
||||
x="25"
|
||||
y="5"
|
||||
width="150"
|
||||
height="50"
|
||||
x="5%"
|
||||
y="5%"
|
||||
width="90%"
|
||||
height="90%"
|
||||
fill="rgb(0,0,255)"
|
||||
strokeWidth="3"
|
||||
stroke="rgb(0,0,0)"
|
||||
|
||||
Reference in New Issue
Block a user