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 » ProgressIndicator::Set for large value of total
ProgressIndicator::Set for large value of total [message #39730] Sun, 21 April 2013 19:54
busiek is currently offline  busiek
Messages: 64
Registered: February 2011
Location: Poland
Member
ProgressIndicator::Set for large total overflows resulting in strange behavior. Solution is to patch uppsrc/CtrlLib/Progress.cpp:

@@ -108,7 +108,7 @@ void ProgressIndicator::Set(int _actual, int _total) {
 	}
 	else {
 		int l = max(1, max(sz.cx, sz.cy));
-		p = total ? min(actual * l / total, l) : 0;
+		p = total ? min(iscale(actual, l, total), l) : 0;
 	}
 	if(p != pxp) {
 		pxp = p;
Previous Topic: Slider with thermometer like scale
Next Topic: SliderCtrl with UHD
Goto Forum:
  


Current Time: Sat Apr 20 01:23:43 CEST 2024

Total time taken to generate the page: 0.02175 seconds