From 3358d3dda387ae55d68dc7989135dad4a8368b39 Mon Sep 17 00:00:00 2001 From: Johan-dutoit Date: Tue, 21 Jul 2020 15:09:35 +0200 Subject: [PATCH] feat(linecap): add control fill line cap separately from arc line cap --- index.d.ts | 8 ++++++++ src/CircularProgress.js | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/index.d.ts b/index.d.ts index 94a72a4..77ad9cf 100644 --- a/index.d.ts +++ b/index.d.ts @@ -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 * diff --git a/src/CircularProgress.js b/src/CircularProgress.js index b7a7e8a..87294d6 100644 --- a/src/CircularProgress.js +++ b/src/CircularProgress.js @@ -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" />