Skip to content

Commit

Permalink
fix fill is being filled even in yet unplotted areas
Browse files Browse the repository at this point in the history
  • Loading branch information
ElderOrb committed Jul 3, 2024
1 parent 936aa8a commit 644b341
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/GUI/Plot.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,12 @@ class PlotCurve : public QwtPlotCurve {
if(m_fillCurve)
baselinePolygon = mapper.toPolygonF( xMap, yMap, m_fillCurve->data(), from, to);
else if(m_fillBaseline) {
baselinePolygon += QPointF(xMap.transform(qreal(from)), yMap.transform(m_fillBaseline.value()));
baselinePolygon += QPointF(xMap.transform(qreal(to)), yMap.transform(m_fillBaseline.value()));
const PlotSeriesData* plotSeriesData = static_cast<const PlotSeriesData*>(data());
auto fromSample = plotSeriesData->sample(from);
auto toSample = plotSeriesData->sample(to);

baselinePolygon += QPointF(xMap.transform(qreal(fromSample.x())), yMap.transform(m_fillBaseline.value()));
baselinePolygon += QPointF(xMap.transform(qreal(toSample.x())), yMap.transform(m_fillBaseline.value()));
}

for(auto it = baselinePolygon.rbegin(); it != baselinePolygon.rend(); ++it) {
Expand Down

0 comments on commit 644b341

Please sign in to comment.