Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ export class ProgressCircle extends Component {
thickness: PropTypes.number,
unfilledColor: PropTypes.string,
endAngle: PropTypes.number,
unfilledEndAngle: PropTypes.number,
allowFontScaling: PropTypes.bool,
};

Expand All @@ -55,6 +56,7 @@ export class ProgressCircle extends Component {
size: 40,
thickness: 3,
endAngle: 0.9,
unfilledEndAngle: 0.9,
allowFontScaling: true,
};

Expand Down Expand Up @@ -96,6 +98,7 @@ export class ProgressCircle extends Component {
thickness,
unfilledColor,
endAngle,
unfilledEndAngle,
allowFontScaling,
...restProps
} = this.props;
Expand All @@ -114,8 +117,11 @@ export class ProgressCircle extends Component {
const Shape = animated ? AnimatedArc : Arc;
const progressValue = animated ? this.progressValue : progress;
const angle = animated
? Animated.multiply(progress, CIRCLE)
: progress * CIRCLE;
? Animated.multiply(Animated.multiply(progress, CIRCLE), unfilledEndAngle)
: progress * CIRCLE * unfilledEndAngle;
const endUnfilledAngleValue = animated
? Animated.multiply(unfilledEndAngle, CIRCLE)
: unfilledEndAngle * CIRCLE;

return (
<View style={[styles.container, style]} {...restProps}>
Expand All @@ -137,13 +143,13 @@ export class ProgressCircle extends Component {
: undefined
}
>
{unfilledColor && progressValue !== 1 ? (
{unfilledColor ? (
<Shape
fill={fill}
radius={radius}
offset={offset}
startAngle={angle}
endAngle={CIRCLE}
endAngle={endUnfilledAngleValue}
direction={direction}
stroke={unfilledColor}
strokeWidth={thickness}
Expand Down