Merge pull request #31 from livioso/patch-1

Use Math.min / Math.max for extractFill.
This commit is contained in:
Markus Lindqvist 2017-11-20 16:47:49 +02:00 committed by GitHub
commit 73b1aa72d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,13 +16,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() {