mirror of
https://github.com/bartgryszko/react-native-circular-progress.git
synced 2026-01-25 16:25:58 +00:00
Use Math.min / Math.max for extractFill.
This commit is contained in:
parent
9510bcfbda
commit
b01c288c07
@ -22,13 +22,7 @@ export default class CircularProgress extends React.Component {
|
||||
}
|
||||
|
||||
extractFill(fill) {
|
||||
if (fill < 0.01) {
|
||||
return 0;
|
||||
} else if (fill > 100) {
|
||||
return 100;
|
||||
}
|
||||
|
||||
return fill;
|
||||
return Math.min(100, Math.max(0, fill));
|
||||
}
|
||||
|
||||
render() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user