You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When max is 100 (default) and progress is 53, drawTextContent() writes "52%" rather than the expected "53%".
int percent = (int) (((float) progress / (float) max) * 100);
Seems like 53.0 / 100.0 results in 0.5299...
The same issue for 59%.
Suggestions:
(1) Check if max is 100, and if so, use progress as percent -- this must be very safe
(2) Add 0.5 before casting to int -- this might not be safe. Which do we want when, for example, progress is 2 and max is 30, 6% or 7%?
The text was updated successfully, but these errors were encountered:
When max is 100 (default) and progress is 53, drawTextContent() writes "52%" rather than the expected "53%".
int percent = (int) (((float) progress / (float) max) * 100);
Seems like 53.0 / 100.0 results in 0.5299...
The same issue for 59%.
Suggestions:
(1) Check if max is 100, and if so, use progress as percent -- this must be very safe
(2) Add 0.5 before casting to int -- this might not be safe. Which do we want when, for example, progress is 2 and max is 30, 6% or 7%?
The text was updated successfully, but these errors were encountered: