summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2018-10-08 17:58:03 (GMT)
committerGitHub <noreply@github.com>2018-10-08 17:58:03 (GMT)
commit2de851266749461bfba1b6e8fb69eeeee79e1e4e (patch)
treeef4e62177d1985d9b6edf86604085f9f5b91a915
parentb4835df704d970697fffb82ff45a0f719a92b376 (diff)
parent35f226b82d3c28042fa1b7408cdc72f92e0167af (diff)
downloadblt-2de851266749461bfba1b6e8fb69eeeee79e1e4e.zip
blt-2de851266749461bfba1b6e8fb69eeeee79e1e4e.tar.gz
blt-2de851266749461bfba1b6e8fb69eeeee79e1e4e.tar.bz2
Merge pull request #22 from prs-de/fix-smoothing-crash-with-no-points
Fix crash with step smoothing when no points were displayed
-rw-r--r--generic/tkbltGrElemLine.C3
1 files changed, 1 insertions, 2 deletions
diff --git a/generic/tkbltGrElemLine.C b/generic/tkbltGrElemLine.C
index ac70b7a..9e3f39a 100644
--- a/generic/tkbltGrElemLine.C
+++ b/generic/tkbltGrElemLine.C
@@ -309,7 +309,6 @@ void LineElement::map()
if (!ops->coords.x || !ops->coords.y ||
!ops->coords.x->nValues() || !ops->coords.y->nValues())
return;
- int np = NUMBEROFPOINTS(ops);
MapInfo mi;
getScreenPoints(&mi);
@@ -320,7 +319,7 @@ void LineElement::map()
// Map connecting line segments if they are to be displayed.
smooth_ = (Smoothing)ops->reqSmooth;
- if ((np > 1) && (ops->builtinPen.traceWidth > 0)) {
+ if ((mi.nScreenPts > 1) && (ops->builtinPen.traceWidth > 0)) {
// Do smoothing if necessary. This can extend the coordinate array,
// so both mi.points and mi.nPoints may change.
switch (smooth_) {