Skip to content

Commit

Permalink
Fix animation strategies IN_EXPO and OUT_EXPO.
Browse files Browse the repository at this point in the history
  • Loading branch information
RedEpicness committed Nov 13, 2023
1 parent f4bdee3 commit 10e2fb0
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,12 +116,12 @@ enum class Animations : AnimationStrategy {
},
IN_EXP {
override fun getValue(percentComplete: Float): Float {
return 2f.pow(10 * (percentComplete - 1))
return if(percentComplete == 0f) 0f else 2f.pow(10 * (percentComplete - 1))
}
},
OUT_EXP {
override fun getValue(percentComplete: Float): Float {
return -(2f.pow(-10 * percentComplete)) + 1
return if(percentComplete == 1f) 1f else -(2f.pow(-10 * percentComplete)) + 1
}
},
IN_OUT_EXP {
Expand Down Expand Up @@ -201,4 +201,4 @@ enum class Animations : AnimationStrategy {
return OUT_BOUNCE.getValue(percentComplete * 2 - 1) * 0.5f + 0.5f
}
}
}
}

0 comments on commit 10e2fb0

Please sign in to comment.