diff options
author | B. Stack <bgstack15@gmail.com> | 2021-05-10 12:09:24 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2021-05-10 12:09:24 +0000 |
commit | 692fd264ae30b5b844f748626262e79bc3d5a7e2 (patch) | |
tree | 9261c60b81eb28e068f0f2f44fd8e60214462b2a /wx+/graph.cpp | |
parent | Merge branch '11.9' into 'master' (diff) | |
parent | add upstream 11.10 (diff) | |
download | FreeFileSync-692fd264ae30b5b844f748626262e79bc3d5a7e2.tar.gz FreeFileSync-692fd264ae30b5b844f748626262e79bc3d5a7e2.tar.bz2 FreeFileSync-692fd264ae30b5b844f748626262e79bc3d5a7e2.zip |
Merge branch '11.10' into 'master'11.10
add upstream 11.10
See merge request opensource-tracking/FreeFileSync!33
Diffstat (limited to 'wx+/graph.cpp')
-rw-r--r-- | wx+/graph.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/wx+/graph.cpp b/wx+/graph.cpp index be75ac4d..8dec2074 100644 --- a/wx+/graph.cpp +++ b/wx+/graph.cpp @@ -511,7 +511,7 @@ void Graph2D::onMouseCaptureLost(wxMouseCaptureLostEvent& event) } -void Graph2D::addCurve(const std::shared_ptr<CurveData>& data, const CurveAttributes& ca) +void Graph2D::addCurve(const SharedRef<CurveData>& data, const CurveAttributes& ca) { CurveAttributes newAttr = ca; if (newAttr.autoColor) @@ -587,10 +587,9 @@ void Graph2D::render(wxDC& dc) const //detect x value range double minX = attr_.minX ? *attr_.minX : std::numeric_limits<double>::infinity(); //automatic: ensure values are initialized by first curve double maxX = attr_.maxX ? *attr_.maxX : -std::numeric_limits<double>::infinity(); // - for (auto it = curves_.begin(); it != curves_.end(); ++it) - if (const CurveData* curve = it->first.get()) + for (const auto& [curve, attrib] : curves_) { - const std::pair<double, double> rangeX = curve->getRangeX(); + const std::pair<double, double> rangeX = curve.ref().getRangeX(); assert(rangeX.first <= rangeX.second + 1.0e-9); //GCC fucks up badly when comparing two *binary identical* doubles and finds "begin > end" with diff of 1e-18 @@ -620,12 +619,12 @@ void Graph2D::render(wxDC& dc) const std::vector<std::vector<char>> oobMarker (curves_.size()); //effectively a std::vector<bool> marking points that start an out-of-bounds line for (size_t index = 0; index < curves_.size(); ++index) - if (const CurveData* curve = curves_[index].first.get()) { + const CurveData& curve = curves_ [index].first.ref(); std::vector<CurvePoint>& points = curvePoints[index]; auto& marker = oobMarker [index]; - points = curve->getPoints(minX, maxX, graphArea.GetSize()); + points = curve.getPoints(minX, maxX, graphArea.GetSize()); marker.resize(points.size()); //default value: false if (!points.empty()) { |