summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdrián Medraño Calvo <adrian@medranocalvo.com>2018-10-08 12:00:00 (GMT)
committerAdrián Medraño Calvo <adrian@medranocalvo.com>2018-10-08 12:00:00 (GMT)
commit35f226b82d3c28042fa1b7408cdc72f92e0167af (patch)
tree9c183154d9fc4f79cbad6e15a5622858cbeab09c
parent9b8c9769c0b7ad4e232550609f8e99d3d5b24f3c (diff)
downloadblt-35f226b82d3c28042fa1b7408cdc72f92e0167af.zip
blt-35f226b82d3c28042fa1b7408cdc72f92e0167af.tar.gz
blt-35f226b82d3c28042fa1b7408cdc72f92e0167af.tar.bz2
Fix crash with step smoothing when no points were displayed
Smoothing must look at the number of displayed points.
-rw-r--r--generic/tkbltGrElemLine.C3
1 files changed, 1 insertions, 2 deletions
diff --git a/generic/tkbltGrElemLine.C b/generic/tkbltGrElemLine.C
index 19a572e..c6eaef2 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_) {