We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5baec20 commit 7039a4dCopy full SHA for 7039a4d
1 file changed
src/Line.tsx
@@ -65,18 +65,12 @@ const Line: React.FC<ProgressProps> = (props) => {
65
fillOpacity="0"
66
/>
67
{percentList.map((ptg, index) => {
68
- let dashPercent = 1;
69
- switch (strokeLinecap) {
70
- case 'round':
71
- dashPercent = 1 - strokeWidth / 100;
72
- break;
73
- case 'square':
74
- dashPercent = 1 - strokeWidth / 2 / 100;
75
76
- default:
77
- dashPercent = 1;
78
79
- }
+ const dashPercent =
+ strokeLinecap === 'round'
+ ? 1 - strokeWidth / 100
+ : strokeLinecap === 'square'
+ ? 1 - strokeWidth / 2 / 100
+ : 1;
80
const pathStyle: React.CSSProperties = {
81
strokeDasharray: `${ptg * dashPercent}px, 100px`,
82
strokeDashoffset: `-${stackPtg}px`,
0 commit comments