Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Slider&ProgressIndicator » Progress overflow
Progress overflow [message #47640] Mon, 20 February 2017 23:50 Go to next message
mdelfede is currently offline  mdelfede
Messages: 1187
Registered: September 2007
Senior Veteran
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
Re: Progress overflow [message #47704 is a reply to message #47640] Tue, 07 March 2017 23:34 Go to previous message
mirek is currently offline  mirek
Messages: 11046
Registered: November 2005
Ultimate Member
Good catch, thanks, applied.
Previous Topic: SliderCtrl with UHD
Goto Forum:
  


Current Time: Sat Jun 24 19:27:44 CEST 2017

Total time taken to generate the page: 0.03713 seconds