oblador / react-native-progress

Progress indicators and spinners for React Native
MIT License
3.62k stars 515 forks source link

add: unfilledEndAngle prop to Circle.js #243

Open cwnicoletti opened 2 years ago

cwnicoletti commented 2 years ago

I was looking to use Progress.Circle as a semi-circle loader, however it seemed that the unfilled portion of the Circle.js component is always a constant of const CIRCLE = Math.PI * 2. I thought I'd contribute a new prop that allows users to dynamically set the end angle of the unfilled portion of the circle with the unfilledEndAngle prop. This would allow users to make a semi-circle that's unfilled.

It's written basically the same exact way as the endAngle prop.

This also makes sure no shapes are shown if unfilledEndAngle is less than or equal to the current startAngle of the <Shape /> component inside Circle.js. (Can be checked by turning the color prop to rgba(0,0,0,0))

cwnicoletti commented 2 years ago

I forgot to include this change in the README, if you'd prefer it does let me know

cwnicoletti commented 2 years ago

Honestly I was thinking too, that since I'm making this into more of an arc than a circle, maybe instead of these last 2 PR, I could create a completely different loader called Arc.js

oblador commented 1 year ago

Yeah, if your use case is not a Circle, it makes more sense to add a new Arc component like you said 👍