Skip to content

Commit

Permalink
Merge pull request #262 from Targoman/tell_credit_value_for_mtcharts_…
Browse files Browse the repository at this point in the history
…progressbar

fix min=-1 for mt charts
  • Loading branch information
kambizzandi authored Nov 28, 2022
2 parents 485ec3f + 86ccd69 commit 883c82a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ModuleHelpers/MT/Interfaces/intfMTCharts.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -898,27 +898,27 @@ QVariant baseintfMTCharts::remainedDataForProgressBar(
Title = TitleParts.join(" - ");
}

quint32 Min;
qint32 Min;
quint32 Max;
quint32 Value;

// if (it->Remained == -1)
if (it->Credit == -1) {
Min = -1;
Max = 1;
Value = 0;
Max = 1;
} else if ((it->Credit == 0) || (it->Remained == 0)) {
Min = 0;
Max = 1;
Value = 1;
Max = 1;
} else if (it->Remained == -1) {
Min = 0;
Max = it->Credit;
Value = 0;
Max = it->Credit;
} else {
Min = 0;
Max = it->Credit;
Value = it->Remained; //(quint32)(((double)it->Remained * 100.0) / (double)it->Credit);
Max = it->Credit;
}

Result.append(QVariantMap({
Expand Down

0 comments on commit 883c82a

Please sign in to comment.