diff options
Diffstat (limited to 'generic/tkbltGrElemLine.C')
-rw-r--r-- | generic/tkbltGrElemLine.C | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/generic/tkbltGrElemLine.C b/generic/tkbltGrElemLine.C index 513e568..f8ec8f7 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_) { @@ -534,11 +533,27 @@ void LineElement::draw(Drawable drawable) delete [] points; } + // Error bars + for (ChainLink* link = Chain_FirstLink(ops->stylePalette); link; + link = Chain_NextLink(link)) { + LineStyle* stylePtr = (LineStyle*)Chain_GetValue(link); + LinePen* penPtr = (LinePen *)stylePtr->penPtr; + LinePenOptions* penOps = (LinePenOptions*)penPtr->ops(); + + if ((stylePtr->xeb.length > 0) && (penOps->errorBarShow & SHOW_X)) + graphPtr_->drawSegments(drawable, penPtr->errorBarGC_, + stylePtr->xeb.segments, stylePtr->xeb.length); + + if ((stylePtr->yeb.length > 0) && (penOps->errorBarShow & SHOW_Y)) + graphPtr_->drawSegments(drawable, penPtr->errorBarGC_, + stylePtr->yeb.segments, stylePtr->yeb.length); + } + // traces if ((Chain_GetLength(traces_) > 0) && (penOps->traceWidth > 0)) drawTraces(drawable, penPtr); - // Symbols, error bars, values + // Symbols, values if (ops->reqMaxSymbols > 0) { int total = 0; for (ChainLink* link = Chain_FirstLink(ops->stylePalette); link; @@ -557,14 +572,6 @@ void LineElement::draw(Drawable drawable) LinePen* penPtr = (LinePen *)stylePtr->penPtr; LinePenOptions* penOps = (LinePenOptions*)penPtr->ops(); - if ((stylePtr->xeb.length > 0) && (penOps->errorBarShow & SHOW_X)) - graphPtr_->drawSegments(drawable, penPtr->errorBarGC_, - stylePtr->xeb.segments, stylePtr->xeb.length); - - if ((stylePtr->yeb.length > 0) && (penOps->errorBarShow & SHOW_Y)) - graphPtr_->drawSegments(drawable, penPtr->errorBarGC_, - stylePtr->yeb.segments, stylePtr->yeb.length); - if ((stylePtr->symbolPts.length > 0) && (penOps->symbol.type != SYMBOL_NONE)) drawSymbols(drawable, penPtr, stylePtr->symbolSize, |