Home » U++ Library support » Slider&ProgressIndicator » Progress overflow
Progress overflow [message #47640] |
Mon, 20 February 2017 23:50  |
mdelfede
Messages: 1308 Registered: September 2007
|
Ultimate Contributor |
|
|
Hi, progress is overflowing for large values, giving negative % when Percent is enabled.
In Progress.cpp, from line 56 :
w.DrawRect(r1, Nvl(color, SColorHighlight()));
w.DrawRect(r2, SColorPaper);
w.DrawRect(r3, SColorPaper);
if(percent) {
String pt = Format("%d %%", 100 * actual / max(total, 1));
Size psz = GetTextSize(pt, StdFont());
should be
w.DrawRect(r1, Nvl(color, SColorHighlight()));
w.DrawRect(r2, SColorPaper);
w.DrawRect(r3, SColorPaper);
if(percent) {
String pt = Format("%d %%", (int)(100L * actual / max(total, 1)));
Size psz = GetTextSize(pt, StdFont());
Ciao
Max
|
|
|
|
Goto Forum:
Current Time: Fri Apr 25 07:55:29 CEST 2025
Total time taken to generate the page: 0.00730 seconds
|