From 35f226b82d3c28042fa1b7408cdc72f92e0167af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Medra=C3=B1o=20Calvo?= Date: Mon, 8 Oct 2018 12:00:00 +0000 Subject: Fix crash with step smoothing when no points were displayed Smoothing must look at the number of displayed points. --- generic/tkbltGrElemLine.C | 3 +-- 1 file changed, 1 insertion(+), 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_) { -- cgit v0.12