From 2672b9394d527ea997f9de4415b4defed20e4cb9 Mon Sep 17 00:00:00 2001 From: William Joye Date: Wed, 19 Sep 2018 15:52:47 -0400 Subject: Squashed 'tkblt/' changes from c383650b..102cc58b 102cc58b Merge pull request #16 from prs-de/fix-xylowhigh-segfault 7f08010f Merge pull request #15 from prs-de/fix-negative-halo-distances 9f679ee2 NULL check to prevent segfault 1bf38a3a Halo distances must be absolute values git-subtree-dir: tkblt git-subtree-split: 102cc58b734175657d3112ccf51f6159bfd04518 --- generic/tkbltGrElemLine.C | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/generic/tkbltGrElemLine.C b/generic/tkbltGrElemLine.C index ac2b340..19a572e 100644 --- a/generic/tkbltGrElemLine.C +++ b/generic/tkbltGrElemLine.C @@ -1728,7 +1728,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) if ((isfinite(x)) && (isfinite(y))) { double high; double low; - if (ops->xError->nValues() > 0) { + if (ops->xError && ops->xError->nValues() > 0) { high = x + ops->xError->values_[ii]; low = x - ops->xError->values_[ii]; } @@ -1795,7 +1795,7 @@ void LineElement::mapErrorBars(LineStyle **styleMap) if ((isfinite(x)) && (isfinite(y))) { double high; double low; - if (ops->yError->nValues() > 0) { + if (ops->yError && ops->yError->nValues() > 0) { high = y + ops->yError->values_[ii]; low = y - ops->yError->values_[ii]; } @@ -1898,8 +1898,8 @@ void LineElement::closestPoint(ClosestSearch *searchPtr) int count =0; for (Point2d *pp = symbolPts_.points; count < symbolPts_.length; count++, pp++) { - double dx = (double)(searchPtr->x - pp->x); - double dy = (double)(searchPtr->y - pp->y); + double dx = (double)abs(searchPtr->x - pp->x); + double dy = (double)abs(searchPtr->y - pp->y); double d; if (searchPtr->along == SEARCH_BOTH) d = hypot(dx, dy); -- cgit v0.12