Adding Indended Plot Markers for AllPlot

I intentionally didn't add the IndendPlotMarkers to all markings,
but only to the interval markers at the top of the plot.

NOTE: the height of the spacing is actually what Qwt tells us
is the textheight.
I think this spacing is rather big.
We might want to reduce it somehow in the future.

Signed-off-by: Simon Egli (Silzo) <smn.egli@gmail.com>
This commit is contained in:
Simon Egli (Silzo)
2015-04-05 17:47:15 +02:00
parent 602d108b82
commit 787932f183
2 changed files with 11 additions and 1 deletions

View File

@@ -32,6 +32,7 @@
#include "Zones.h"
#include "Colors.h"
#include "WPrime.h"
#include "IndendPlotMarker.h"
#include <qwt_plot_curve.h>
#include <qwt_plot_canvas.h>
@@ -2299,6 +2300,8 @@ AllPlot::recalc(AllPlotObject *objects)
void
AllPlot::refreshIntervalMarkers()
{
QwtIndPlotMarker::resetDrawnLabels();
foreach(QwtPlotMarker *mrk, standard->d_mrk) {
mrk->detach();
delete mrk;
@@ -2316,7 +2319,7 @@ AllPlot::refreshIntervalMarkers()
if (interval.isBest() || interval.isPeak() ||
interval.isMatch()) nolabel = true;
QwtPlotMarker *mrk = new QwtPlotMarker;
QwtPlotMarker *mrk = new QwtIndPlotMarker;
standard->d_mrk.append(mrk);
mrk->attach(this);
mrk->setLineStyle(QwtPlotMarker::VLine);
@@ -2473,6 +2476,11 @@ AllPlot::plotReferenceLine(const RideFilePoint *referencePoint)
return referenceLine;
}
void
AllPlot::replot() {
QwtIndPlotMarker::resetDrawnLabels();
QwtPlot::replot();
}
void
AllPlot::setYMax()