Skip to content

Commit

Permalink
Fix Bubble ArcTo NaN error
Browse files Browse the repository at this point in the history
.. by filtering out points we don't want (note how
   the class member 'points' was masked by the parameter
   'points' in BubbleViz::setPoints() (!)

.. will wrap by own knuckles for bad practice.
  • Loading branch information
liversedge committed Mar 6, 2017
1 parent f79ea75 commit 2dc92d5
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Charts/OverviewWindow.cpp
Expand Up @@ -1551,19 +1551,20 @@ BubbleViz::sceneEvent(QEvent *event)
}

void
BubbleViz::setPoints(QList<BPointF> points)
BubbleViz::setPoints(QList<BPointF> p)
{
oldpoints = this->points;
oldmean = this->mean;

this->points=points;
double sum=0, count=0;
foreach(BPointF point, points) {
this->points.clear();
foreach(BPointF point, p) {

if (point.x < minx || point.x > maxx ||
point.y < miny || point.y > maxy ||
!std::isfinite(point.z) || std::isnan(point.z)) continue;
if (point.x < minx || point.x > maxx || !std::isfinite(point.x) || std::isnan(point.x) || point.x == 0 ||
point.y < miny || point.y > maxy || !std::isfinite(point.y) || std::isnan(point.y) || point.y == 0 ||
point.z == 0 || !std::isfinite(point.z) || std::isnan(point.z)) continue;

this->points << point;
sum += point.z;
count++;
}
Expand Down

0 comments on commit 2dc92d5

Please sign in to comment.