From 607955dafe8b04ace8cb7ffce3143136f71e85f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Miranda?= Date: Fri, 10 Feb 2017 10:35:37 -0200 Subject: [PATCH 1/3] Replace RNSVGBrushConverter with RNSVGPainter This modification was made in cfaca8b3cb166207357b7b945151762db81d3053, but was missing in a private method signature inside RNSVGPattern.m --- ios/Brushes/RNSVGPattern.m | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ios/Brushes/RNSVGPattern.m b/ios/Brushes/RNSVGPattern.m index 2a209723..02983742 100644 --- a/ios/Brushes/RNSVGPattern.m +++ b/ios/Brushes/RNSVGPattern.m @@ -39,7 +39,7 @@ // Note: This could use applyFillColor with a pattern. This could be more efficient but // to do that, we need to calculate our own user space CTM. -- (void)paint:(CGContextRef)context opacity:(CGFloat)opacity brushConverter:(RNSVGBrushConverter *)brushConverter; +- (void)paint:(CGContextRef)context opacity:(CGFloat)opacity brushConverter:(RNSVGPainter *)brushConverter; { CGContextDrawTiledImage(context, _rect, _image); } From 4f4b8e54a71f0fde5898b06947fe895dd2d3f0ee Mon Sep 17 00:00:00 2001 From: Joshua Pinter Date: Thu, 2 Mar 2017 10:48:08 -0700 Subject: [PATCH 2/3] Add manual Android instructions. Especially important when integrating React Native into existing applications that rnpm or react-native link don't work. --- README.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/README.md b/README.md index c314b003..4c5107fd 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,8 @@ ### Installation +#### Automatic + *With Exponent, this is pre-installed. Jump ahead to [Usage](#Usage)* 1. Install library from `npm` @@ -42,6 +44,30 @@ ```bash rnpm link react-native-svg ``` + +#### Manual + +##### Android + +1. `npm install react-native-svg --save` + +2. Append the following lines to `android/settings.gradle`: + + ``` + include ':react-native-svg' + project(':react-native-svg').projectDir = new File(rootProject.projectDir, './node_modules/react-native-svg/android') + ``` + +3. Insert the following lines inside the dependencies block in `android/app/build.gradle`: + + ``` + compile project(':react-native-svg') + ``` + +4. Open up `android/app/src/main/java/[...]/MainApplication.java + - Add `import com.horcrux.svg.SvgPackage;` to the imports at the top of the file + - Add `new SvgPackage()` to the list returned by the `getPackages()` method. Add a comma to the previous item if there's already something there. + ### Usage From c565e759b28f2a55d2129da01fbaaedee509b572 Mon Sep 17 00:00:00 2001 From: Joshua Pinter Date: Thu, 2 Mar 2017 12:30:56 -0700 Subject: [PATCH 3/3] Add possible options for `strokeLinecap` and `strokeLinejoin`. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c314b003..1c2a84b3 100644 --- a/README.md +++ b/README.md @@ -109,8 +109,8 @@ fillOpacity | 1 | This prop specifies the opacity of the color or t stroke | 'none' | The stroke prop controls how the outline of a shape appears. strokeWidth | 1 | The strokeWidth prop specifies the width of the outline on the current object. strokeOpacity | 1 | The strokeOpacity prop specifies the opacity of the outline on the current object. -strokeLinecap | 'square' | The strokeLinecap prop specifies the shape to be used at the end of open subpaths when they are stroked. -strokeLinejoin | 'miter' | The strokeLinejoin prop specifies the shape to be used at the corners of paths or basic shapes when they are stroked. +strokeLinecap | 'square' | The strokeLinecap prop specifies the shape to be used at the end of open subpaths when they are stroked. Can be either `'butt'`, `'square'` or `'round'`. +strokeLinejoin | 'miter' | The strokeLinejoin prop specifies the shape to be used at the corners of paths or basic shapes when they are stroked. Can be either `'miter'`, `'bevel'` or `'round'`. strokeDasharray | [] | The strokeDasharray prop controls the pattern of dashes and gaps used to stroke paths. strokeDashoffset| null | The strokeDashoffset prop specifies the distance into the dash pattern to start the dash. x | 0 | Translate distance on x-axis.