Skip to content

Commit

Permalink
Fix for alpha going outside valid range
Browse files Browse the repository at this point in the history
Fixes #34
  • Loading branch information
kirill-grouchnikov committed Dec 16, 2022
1 parent 133a345 commit 6459893
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class ModelStateInfo(startModelState: ComponentState) {
activeStrength += value.contribution
}
}
if (activeStrength > 1.0f) {
// Can happen due to floating point rounding errors
activeStrength = 1.0f
}
}

fun strength(facet: ComponentStateFacet): Float {
Expand Down

0 comments on commit 6459893

Please sign in to comment.