Skip to content

Commit

Permalink
fixes #24
Browse files Browse the repository at this point in the history
  • Loading branch information
alexjlockwood committed Jan 10, 2018
1 parent 0881eb6 commit 3838060
Show file tree
Hide file tree
Showing 7 changed files with 37 additions and 17 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
"devDependencies": {
"@types/chai": "^4.0.10",
"@types/mocha": "^2.2.45",
"@types/node": "^8.5.2",
"@types/node": "^9.3.0",
"@types/sax": "^1.0.0",
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"mocha": "^4.0.1",
"nyc": "^11.4.1",
"prettier": "1.9.2",
"prettier": "1.10.1",
"should": "^13.1.3",
"ts-node": "^4.1.0",
"typescript": "^2.6.2"
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/convertPathData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ let arcTolerance: number;
export const defaultParams = {
applyTransforms: true,
applyTransformsStroked: true,
makeArcs: {
threshold: 2.5, // Coefficient of rounding error.
tolerance: 0.5, // Percentage of radius.
},
makeArcs: undefined as { threshold: number; tolerance: number },
// {
// threshold: 2.5, // Coefficient of rounding error.
// tolerance: 0.5, // Percentage of radius.
// },
straightCurves: true,
lineShorthands: true,
curveSmoothShorthands: true,
Expand Down
2 changes: 1 addition & 1 deletion test/plugins/convertPathData.14.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@

@@@

{ "leadingZero": true }
{ "leadingZero": true, "makeArcs": { "threshold": 2.5, "tolerance": 0.5 } }
2 changes: 1 addition & 1 deletion test/plugins/convertPathData.15.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

@@@

{ "floatPrecision": 2, "leadingZero": true }
{ "floatPrecision": 2, "leadingZero": true, "makeArcs": { "threshold": 2.5, "tolerance": 0.5 } }
2 changes: 1 addition & 1 deletion test/plugins/convertPathData.16.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

@@@

{ "floatPrecision": 0 }
{ "floatPrecision": 0, "makeArcs": { "threshold": 2.5, "tolerance": 0.5 } }
19 changes: 19 additions & 0 deletions test/plugins/convertPathData.22.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path
android:fillColor="#FFFFFF"
android:pathData="M24.05,15.49 C27.64,15.49,30.55,18.41,30.55,21.99
C30.55,23.38,30.12,24.71,29.3,25.82 L29.28,25.85 L29.26,25.88
C27.93,27.98,27.17,29.55,26.81,31.03 L21.29,31.03 C20.92,29.55,20.17,27.98,18.84,25.88
L18.82,25.85 L18.8,25.82 C17.98,24.7,17.55,23.38,17.55,21.99
C17.54,18.4,20.46,15.49,24.05,15.49 M24.05,14.28 C19.79,14.28,16.34,17.73,16.34,21.99
C16.34,23.69,16.89,25.26,17.82,26.54 C19.18,28.67,19.91,30.22,20.21,31.73
C20.27,32.03,20.53,32.25,20.84,32.25 L27.26,32.25 C27.57,32.25,27.83,32.03,27.89,31.73
C28.19,30.22,28.92,28.67,30.28,26.54 C31.21,25.26,31.76,23.69,31.76,21.99
C31.76,17.73,28.31,14.28,24.05,14.28 Z"/>
</vector>

@@@

<vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="24dp" android:height="24dp" android:viewportWidth="24" android:viewportHeight="24">
<path android:fillColor="#FFFFFF" android:pathData="M24.05 15.49c3.59 0 6.5 2.92 6.5 6.5 0 1.39-0.43 2.72-1.25 3.83l-0.02 0.03-0.02 0.03c-1.33 2.1-2.09 3.67-2.45 5.15h-5.52c-0.37-1.48-1.12-3.05-2.45-5.15l-0.02-0.03-0.02-0.03c-0.82-1.12-1.25-2.44-1.25-3.83-0.01-3.59 2.91-6.5 6.5-6.5m0-1.21c-4.26 0-7.71 3.45-7.71 7.71 0 1.7 0.55 3.27 1.48 4.55 1.36 2.13 2.09 3.68 2.39 5.19 0.06 0.3 0.32 0.52 0.63 0.52h6.42c0.31 0 0.57-0.22 0.63-0.52 0.3-1.51 1.03-3.06 2.39-5.19 0.93-1.28 1.48-2.85 1.48-4.55 0-4.26-3.45-7.71-7.71-7.71z"/>
</vector>

0 comments on commit 3838060

Please sign in to comment.