flavioarfaria / KenBurnsView

Android ImageViews animated by Ken Burns Effect
Apache License 2.0
2.73k stars 435 forks source link

Modifies aspect ratio comparison to allow for a tolerance. #16

Closed saguinav closed 10 years ago

saguinav commented 10 years ago

Related to https://github.com/flavioarfaria/KenBurnsView/issues/2

This is still a problem for me. I debugged the MathUtils.haveSameAspectRatio method and found out that every time the exception is thrown the aspect ratios differ in 0.01 because of the previous truncation.

I have modified the comparison operation to allow for a tolerance so it never returns false for aspect ratios that are practically equals.