Fixed the bug where the rating couldn't be zero.#134
Fixed the bug where the rating couldn't be zero.#134CelerityAbbottPC wants to merge 1 commit intodart-archive:masterfrom CelerityAbbottPC:master
Conversation
CelerityAbbottPC
commented
Jan 19, 2015
|
Hi Celebrity: Thanks for the pull request. I'm not 100% sure that this is a bug. Let's say that a recipe in the JSON array specifies 0 as the rating. That is, a recipe starts out with a rating of 0. The starChar method will do the right thing: It returns _STAR_OFF_CHAR for each star because rating is less than even the lowest star int. (The stars[] always starts at 1.) Now if a user clicks the first star and invokes handleClick(), "star == 1 && rating == 1" evaluates to false, so the method sets rating to 1 (the value of the first star). void handleClick(int star) { What were you seeing that seemed like a bug? |