Fix #32  (G elements context bug)
This commit is contained in:
Horcrux
2016-05-13 11:50:03 +08:00
parent ec67d4dae8
commit 91c6115e6e
3 changed files with 25 additions and 10 deletions
+6 -4
View File
@@ -23,10 +23,12 @@ class GExample extends Component{
stroke="pink"
strokeWidth="3"
>
<Circle
cx="25"
cy="25"
/>
<G>
<Circle
cx="25"
cy="25"
/>
</G>
<Circle
cx="25"
cy="75"
+8 -3
View File
@@ -10,7 +10,8 @@ import Svg, {
Ellipse,
Circle,
Text,
Rect
Rect,
G
} from 'react-native-svg';
class LinearGradientHorizontal extends Component{
@@ -32,7 +33,7 @@ class LinearGradientHorizontal extends Component{
}
class LinearGradientVertical extends Component{
static title = 'Define an ellipse with a horizontal linear gradient from yellow to red';
static title = 'Define an ellipse with a vertical linear gradient from yellow to red';
render() {
return <Svg
height="150"
@@ -44,7 +45,11 @@ class LinearGradientVertical extends Component{
<Stop offset="100%" stopColor="red" stopOpacity="1" />
</LinearGradient>
</Defs>
<Ellipse cx="150" cy="75" rx="85" ry="55" fill="url(#grad)" />
<G>
<G>
<Ellipse cx="150" cy="75" rx="85" ry="55" fill="url(#grad)" />
</G>
</G>
</Svg>;
}
}