Skip to content

Commit ac5985d

Browse files
committed
correct inorrect progress percentage
1 parent 10d7bdd commit ac5985d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

packages/core/src/components/Progress/CircularProgress/CircularProgress.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ export const CircularProgress: React.FC<
7979
}
8080
}, [startPosition]);
8181

82-
const currentFillPercentage = value / (maximumValue + minimumValue);
82+
const currentFillPercentage =
83+
(value - minimumValue) / (maximumValue - minimumValue);
8384
const currentAngle = useSharedValue(startAngle);
8485

8586
const progressPathAnimatedProps = useAnimatedProps<PathProps>(() => {

packages/core/src/components/Progress/LinearProgress/LinearProgress.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ export const LinearProgress: React.FC<ValueProgressProps> = ({
5757
const progressLineWidth = svgContainerWidth - thicknessOffset;
5858
const trackProgressLineWidth = svgContainerWidth - thicknessOffset;
5959

60-
const currentFillPercentage = value / (maximumValue + minimumValue);
60+
const currentFillPercentage =
61+
(value - minimumValue) / (maximumValue - minimumValue);
6162
const currentProgressLineWidth = useSharedValue(0);
6263

6364
const progressLineAnimatedProps = useAnimatedProps<LineProps>(() => {

0 commit comments

Comments
 (0)