From 10edc6b0ac40c3b54c75ce4b6d3497980431c9d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20=C4=8Cert=C3=ADk?= Date: Tue, 26 Nov 2019 13:40:05 -0700 Subject: [PATCH] Skip drawing the line for negative values --- lib/jkqtplotter/graphs/jkqtpscatter.cpp | 34 +++++++++++++++---------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/lib/jkqtplotter/graphs/jkqtpscatter.cpp b/lib/jkqtplotter/graphs/jkqtpscatter.cpp index 9dc19035a2..dd265cb108 100644 --- a/lib/jkqtplotter/graphs/jkqtpscatter.cpp +++ b/lib/jkqtplotter/graphs/jkqtpscatter.cpp @@ -34,7 +34,11 @@ - +template +std::unique_ptr make_unique(Args&&... args) +{ + return std::unique_ptr(new T(std::forward(args)...)); +} @@ -94,7 +98,8 @@ void JKQTPXYLineGraph::draw(JKQTPEnhancedPainter& painter) { //double yold=-1; //bool first=false; //QVector lines; - QPolygonF linesP; + std::vector> linesP; + linesP.push_back(make_unique()); intSortData(); for (int iii=imin; iiigetXAxis()->isLogAxis() || xv>0.0) && (!parent->getYAxis()->isLogAxis() || yv>0.0) ) { plotStyledSymbol(parent, painter, x, y); - } - if (drawLine) { - linesP<()); } } } //qDebug()<<"JKQTPXYLineGraph::draw(): "<<4<<" lines="<