Prevent drawing progress bar with negative values
This commit is contained in:
parent
9f0c795c34
commit
35656383e9
1 changed files with 1 additions and 1 deletions
|
@ -32,7 +32,7 @@ struct ProgressView: View {
|
||||||
|
|
||||||
private func getProgressBarWidth(geometry: GeometryProxy) -> CGFloat {
|
private func getProgressBarWidth(geometry: GeometryProxy) -> CGFloat {
|
||||||
let frame = geometry.frame(in: .global)
|
let frame = geometry.frame(in: .global)
|
||||||
return frame.size.width * min(CGFloat(value / maxValue), CGFloat(1))
|
return max(0, frame.size.width * min(CGFloat(value / maxValue), CGFloat(1)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue