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: 143
Registered: May 2008
Experienced 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: 3355
Registered: August 2008
Senior Veteran
Thank you Aftershock.

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

Thank you!


Best regards
IƱaki
Previous Topic: ScatterCtrl Difference in Debug and Release mode.
Next Topic: Use function pointer
Goto Forum:
  


Current Time: Thu Mar 28 14:20:19 CET 2024

Total time taken to generate the page: 0.00984 seconds