diff options
author | William Joye <wjoye@cfa.harvard.edu> | 2018-10-08 17:53:38 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-08 17:53:38 (GMT) |
commit | b4835df704d970697fffb82ff45a0f719a92b376 (patch) | |
tree | a55b2879f91bab94e99b6ff3c3a08892409ecc7a | |
parent | 9b8c9769c0b7ad4e232550609f8e99d3d5b24f3c (diff) | |
parent | 7c97d4ee165ef17cb1e2897925499b0dcfc00aa9 (diff) | |
download | blt-b4835df704d970697fffb82ff45a0f719a92b376.zip blt-b4835df704d970697fffb82ff45a0f719a92b376.tar.gz blt-b4835df704d970697fffb82ff45a0f719a92b376.tar.bz2 |
Merge pull request #23 from prs-de/draw-order
Draw in order: errorBars, traces, symbols, values
-rw-r--r-- | generic/tkbltGrElemLine.C | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/generic/tkbltGrElemLine.C b/generic/tkbltGrElemLine.C index 19a572e..ac70b7a 100644 --- a/generic/tkbltGrElemLine.C +++ b/generic/tkbltGrElemLine.C @@ -534,11 +534,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 +573,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, |