sujithkanna / SmileyRating

SmileyRating is a simple rating bar for android. It displays animated smileys as rating icon.
Apache License 2.0
1.09k stars 184 forks source link

Fix issue #22 #23

Closed addisonElliott closed 7 years ago

addisonElliott commented 7 years ago

Bug in moveSmile function where the calculated fraction when selecting the last smiley would be barely above 1.0f. As an example, while debugging, the result was 1.000001f.

In the moveSmileByFraction function, if the fraction was not between 0.0f->1.0f, then it would return doing nothing. Thus, the solution is to clamp the fraction between 0.0f->1.0f and remove the if statement checking for a valid range.

This bug was only visible in certain instances because it depended on a number of variables whether the fraction was above 1.0f. This is why the bug was only present in certain builds, certain layouts, etc.