Fixed a small rounding issue in GuiThemeDownloader

This commit is contained in:
Leon Styhre 2023-03-22 22:40:14 +01:00
parent 9106013ade
commit e1c78f1932

View file

@ -528,14 +528,14 @@ void GuiThemeDownloader::update(int deltaTime)
if (mFetching) { if (mFetching) {
int progress {mReceivedObjectsProgress != 1.0f ? 0 : 100}; int progress {mReceivedObjectsProgress != 1.0f ? 0 : 100};
if (mReceivedObjectsProgress != 1.0f) { if (mReceivedObjectsProgress != 1.0f) {
progress = std::round(static_cast<int>( progress = static_cast<int>(
glm::mix(0.0f, 100.0f, static_cast<float>(mReceivedObjectsProgress)))); std::round(glm::mix(0.0f, 100.0f, static_cast<float>(mReceivedObjectsProgress))));
const std::string progressText {std::to_string(progress) + "%"}; const std::string progressText {std::to_string(progress) + "%"};
mBusyAnim.setText(progressText); mBusyAnim.setText(progressText);
} }
else if (mReceivedObjectsProgress != 0.0f) { else if (mReceivedObjectsProgress != 0.0f) {
progress = std::round(static_cast<int>( progress = static_cast<int>(
glm::mix(0.0f, 100.0f, static_cast<float>(mResolveDeltaProgress)))); std::round(glm::mix(0.0f, 100.0f, static_cast<float>(mResolveDeltaProgress))));
const std::string progressText {std::to_string(progress) + "%"}; const std::string progressText {std::to_string(progress) + "%"};
mBusyAnim.setText(progressText); mBusyAnim.setText(progressText);
} }