Got the score chart to work

pull/1319/head
Jakub Kalinowski 4 years ago
parent b75d5eeb34
commit 3b650d63b4

@ -100,6 +100,7 @@ class ScoreList {
}
val normalizedRollingSum = rollingSum / 1000
if(values[offset] != Entry.SKIP) {
val percentageCompleted = if (!isAtMost) {
if (targetValue > 0)
min(1.0, normalizedRollingSum / targetValue)
@ -107,13 +108,17 @@ class ScoreList {
1.0
} else {
if (targetValue > 0) {
(1 - ((normalizedRollingSum - targetValue) / targetValue)).coerceIn(0.0, 1.0)
(1 - ((normalizedRollingSum - targetValue) / targetValue)).coerceIn(
0.0,
1.0
)
} else {
if (normalizedRollingSum > 0) 0.0 else 1.0
}
}
previousValue = compute(freq, previousValue, percentageCompleted)
}
} else {
if (values[offset] == Entry.YES_MANUAL) {
rollingSum += 1.0

Loading…
Cancel
Save