From 7d37cde40db4aed87d0953670fb55ea05467896b Mon Sep 17 00:00:00 2001 From: Horcrux Date: Sun, 24 Apr 2016 00:24:15 +0800 Subject: [PATCH] Add polyline strokeLinecap strokeLinejoin example --- Example/examples/Polyline.js | 21 ++++++++++++++++++++- lib/Transform.js | 5 +---- package.json | 2 +- 3 files changed, 22 insertions(+), 6 deletions(-) diff --git a/Example/examples/Polyline.js b/Example/examples/Polyline.js index c0917038..002f0fec 100644 --- a/Example/examples/Polyline.js +++ b/Example/examples/Polyline.js @@ -57,6 +57,25 @@ class PolylineFill extends Component{ } } +class PolylineFillStroke extends Component{ + static title = 'Stroke Polyline with strokeLinecap and strokeLinejoin'; + render() { + return + + ; + } +} + const icon = ; -const samples = [PolylineExample, StraightLines, PolylineFill]; +const samples = [PolylineExample, StraightLines, PolylineFill, PolylineFillStroke]; export { icon, diff --git a/lib/Transform.js b/lib/Transform.js index 322417f6..279155e6 100644 --- a/lib/Transform.js +++ b/lib/Transform.js @@ -51,10 +51,7 @@ export default class { }; scale = (x, y) => { - if (y == null) { - y = x; - } - return this.transform(x, 0, 0, y, 0, 0); + return this.transform(x, 0, 0, y == null ? x : y, 0, 0); }; rotate = (deg, x, y) => { diff --git a/package.json b/package.json index abe323de..0d8d4256 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "version": "1.1.1", + "version": "1.1.2", "name": "react-native-svg", "description": "react native svg library", "repository": {