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 » ScatterDraw & ScatterCtrl » bug in scatterdraw.h and its fix
bug in scatterdraw.h and its fix [message #48026] Thu, 11 May 2017 15:15 Go to next message
aftershock is currently offline  aftershock
Messages: 99
Registered: May 2008
Member
Hi,

I found a bug in scatterdraw.h in ScatterDraw::Plot.

around here
double xx, yy;
if (fastViewX) {
yy = series[j].PointsData()->y(i);
if (IsNull(yy)) {
++i;
continue;
}
int64 ii;
double maxv = dxpix*npix;
double maxY = yy, minY = yy;
for (ii = 1; i + ii < imax && series[j].PointsData()->x(i + ii) < maxv; ++ii) {
double dd = series[j].PointsData()->y(i + ii);
if (IsNull(dd))
continue;
//yy += dd;
maxY = max(maxY, dd);
minY




this line is incorrect
double maxv = dxpix*npix;

the fix is
double maxv = series[j].PointsData()->x(imin)+ dxpix*npix;

The bug causes to have extra points on the graph.. which is ugly, on the left..
a lot of points..

Enjoy!

Re: bug in scatterdraw.h and its fix [message #48035 is a reply to message #48026] Fri, 12 May 2017 10:02 Go to previous message
koldo is currently offline  koldo
Messages: 2726
Registered: August 2008
Location: Basque Country
Senior Veteran
Thank you Aftershock.

You have done a great job finding the bug and solving it.

Thank you!


Best regards
Koldo
Previous Topic: ScatterCtrl Difference in Debug and Release mode.
Goto Forum:
  


Current Time: Fri May 26 18:50:09 CEST 2017

Total time taken to generate the page: 0.00705 seconds