mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
More CP plot fixups
.. allplot color fixed when not a rainbow curve .. fix SEGV index bounds check off by one .. hover curve z-order to top
This commit is contained in:
@@ -703,6 +703,7 @@ CpintPlot::plot_allCurve(CpintPlot *thisPlot,
|
||||
// lets work out how we are shading it
|
||||
switch(shadeMode) {
|
||||
case 0 : // not shading!!
|
||||
shadingCP = 0;
|
||||
break;
|
||||
|
||||
case 1 : // value for current date
|
||||
@@ -928,6 +929,7 @@ CpintPlot::calculate(RideItem *rideItem)
|
||||
for (int i = 0; i < bests->meanMaxArray(rideSeries).size(); ++i) {
|
||||
if (bests->meanMaxArray(rideSeries)[i] > 0) maxNonZero = i;
|
||||
}
|
||||
qDebug()<<"allplot point 1";
|
||||
plot_allCurve(this, maxNonZero, bests->meanMaxArray(rideSeries).constData() + 1, GColor(CCP), false);
|
||||
}
|
||||
} else {
|
||||
@@ -1583,6 +1585,7 @@ CpintPlot::calculateForDateRanges(QList<CompareDateRange> compareDateRanges)
|
||||
}
|
||||
if (i>0) shadeMode = 0;
|
||||
|
||||
qDebug()<<"allplot point 2";
|
||||
plot_allCurve(this, maxNonZero, cache->meanMaxArray(rideSeries).constData() + 1, range.color, true);
|
||||
|
||||
foreach(double v, cache->meanMaxArray(rideSeries)) {
|
||||
|
||||
@@ -678,7 +678,7 @@ CriticalPowerWindow::intervalHover(RideFileInterval x)
|
||||
}
|
||||
}
|
||||
|
||||
if (index >=0 && index <= intervalCurves.count()) {
|
||||
if (index >=0 && index < intervalCurves.count()) {
|
||||
|
||||
// lazy for now just reuse existing
|
||||
if (intervalCurves[index] == NULL) {
|
||||
@@ -707,10 +707,11 @@ CriticalPowerWindow::intervalHover(RideFileInterval x)
|
||||
hoverCurve = new QwtPlotCurve("Interval");
|
||||
hoverCurve->setPen(pen);
|
||||
if (appsettings->value(this, GC_ANTIALIAS, false).toBool() == true) hoverCurve->setRenderHint(QwtPlotItem::RenderAntialiased);
|
||||
hoverCurve->attach(cpintPlot);
|
||||
hoverCurve->setYAxis(QwtPlot::yLeft);
|
||||
hoverCurve->setSamples(array);
|
||||
hoverCurve->setVisible(true);
|
||||
hoverCurve->setZ(100);
|
||||
hoverCurve->attach(cpintPlot);
|
||||
cpintPlot->replot();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user