Skip to content

Commit

Permalink
DesignLibrary: Fix progress bar being messed up when at over 100% (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
anian03 authored Dec 14, 2024
1 parent 9ac01ac commit f28438e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Sources/DesignLibrary/ProgressBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public struct ProgressBar: View {
backgroundColor: Color = Color.Artemis.courseScoreProgressBackgroundColor,
ringColor: Color = Color.Artemis.courseScoreProgressRingColor
) {
self.value = Int(value)
self.value = Int(min(value, total)) // Cap at 100%
self.total = Int(total)
self.percentage = Int((value * 100 / total).rounded())
self.backgroundColor = backgroundColor
Expand Down

0 comments on commit f28438e

Please sign in to comment.