Родитель
920843f52d
Коммит
815540fc28
|
@ -5,6 +5,7 @@ import * as Ellipse from './examples/Ellipse';
|
|||
import * as Line from './examples/Line';
|
||||
import * as Polygon from './examples/Polygon';
|
||||
import * as Polyline from './examples/Polyline';
|
||||
import * as Path from './examples/Path';
|
||||
|
||||
export {
|
||||
Svg,
|
||||
|
@ -13,5 +14,6 @@ export {
|
|||
Ellipse,
|
||||
Line,
|
||||
Polygon,
|
||||
Polyline
|
||||
Polyline,
|
||||
Path
|
||||
};
|
||||
|
|
|
@ -36,6 +36,7 @@ class StrokeCircle extends Component{
|
|||
r="45"
|
||||
stroke="purple"
|
||||
strokeWidth="2.5"
|
||||
fill={null}
|
||||
/>
|
||||
</Svg>;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,55 @@
|
|||
import React, {
|
||||
Component
|
||||
} from 'react-native';
|
||||
|
||||
import Svg, {
|
||||
Path
|
||||
} from 'react-native-art-svg';
|
||||
|
||||
class PathExample extends Component{
|
||||
static title = 'Path';
|
||||
render() {
|
||||
return <Svg
|
||||
height="100"
|
||||
width="100"
|
||||
>
|
||||
<Path
|
||||
d="M50 0 L15 100 L85 100 Z"
|
||||
/>
|
||||
</Svg>;
|
||||
}
|
||||
}
|
||||
|
||||
class UnclosedPath extends Component{
|
||||
static title = 'Unclosed paths';
|
||||
render() {
|
||||
return <Svg
|
||||
height="100"
|
||||
width="100"
|
||||
>
|
||||
<Path
|
||||
d="M25 10 L98 65 L70 25 L16 77 L11 30 L0 4 L90 50 L50 10 L11 22 L77 95 L20 L25"
|
||||
fill="none"
|
||||
stroke="red"
|
||||
/>
|
||||
</Svg>;
|
||||
}
|
||||
}
|
||||
|
||||
const icon = <Svg
|
||||
height="20"
|
||||
width="20"
|
||||
>
|
||||
<Path
|
||||
d="M5 0 L8 10 L10 15 L18 2 L4 18 L5 14 L10 10 Z"
|
||||
stroke="red"
|
||||
fill="none"
|
||||
/>
|
||||
</Svg>;
|
||||
|
||||
const samples = [PathExample, UnclosedPath];
|
||||
|
||||
export {
|
||||
icon,
|
||||
samples
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
### react-native-art-svg
|
||||
|
||||
|
||||
TODO:
|
||||
TODO:
|
||||
1. fill-rule:evenodd
|
||||
2. gradients
|
||||
3. text
|
||||
4. other elements
|
||||
5. animations https://github.com/maxwellito/vivus
|
||||
5. animations https://github.com/maxwellito/vivus
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import rgba from './rgba';
|
||||
export default function (props) {
|
||||
return rgba(props.fill, props.fillOpacity);
|
||||
return rgba(props.fill === undefined ? '#000' : props.fill, props.fillOpacity);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче