feat(linecap): add control fill line cap separately from arc line cap

This commit is contained in:
Johan-dutoit 2020-07-21 15:09:35 +02:00
parent 7c55e7ee0f
commit 3358d3dda3
2 changed files with 10 additions and 1 deletions

8
index.d.ts vendored
View File

@ -87,6 +87,14 @@ declare module 'react-native-circular-progress' {
*/
lineCap?: 'butt' | 'round' | 'square';
/**
* Shape used at ends of progress line.
*
* @type {('butt' | 'round' | 'square')}
* @default lineCap - which is 'butt'
*/
fillLineCap?: 'butt' | 'round' | 'square';
/**
* If you don't want a full circle, specify the arc angle
*

View File

@ -33,6 +33,7 @@ export default class CircularProgress extends React.PureComponent {
style,
rotation,
lineCap,
fillLineCap = lineCap,
arcSweepAngle,
fill,
children,
@ -116,7 +117,7 @@ export default class CircularProgress extends React.PureComponent {
d={circlePath}
stroke={tintColor}
strokeWidth={width}
strokeLinecap={lineCap}
strokeLinecap={fillLineCap}
strokeDasharray={strokeDasharrayTint}
fill="transparent"
/>