# HG changeset patch # User Chris Cannam # Date 1485465589 0 # Node ID 1a7c2ca315796890b5055b1c5b85bf818b634dbf # Parent de1792daae0753b8471bb01cd5fa20822157f6b3 Scale pen, place line ends in centres of bins, default to line mode diff -r de1792daae07 -r 1a7c2ca31579 layer/SliceLayer.cpp --- a/layer/SliceLayer.cpp Thu Jan 26 21:18:55 2017 +0000 +++ b/layer/SliceLayer.cpp Thu Jan 26 21:19:49 2017 +0000 @@ -34,7 +34,7 @@ m_colourMap(0), m_energyScale(dBScale), m_samplingMode(SampleMean), - m_plotStyle(PlotSteps), + m_plotStyle(PlotLines), m_binScale(LinearBins), m_normalize(false), m_threshold(0.0), @@ -331,7 +331,12 @@ } } - paint.setPen(getBaseQColor()); + if (m_plotStyle == PlotBlocks) { + // Must use actual zero-width pen, too slow otherwise + paint.setPen(QPen(getBaseQColor(), 0)); + } else { + paint.setPen(PaintAssistant::scalePen(getBaseQColor())); + } int xorigin = getVerticalScaleWidth(v, true, paint) + 1; int w = v->getPaintWidth() - xorigin - 1; @@ -423,9 +428,9 @@ if (m_plotStyle == PlotLines) { if (bin == 0) { - path.moveTo(x, y); + path.moveTo((x + nx) / 2, y); } else { - path.lineTo(x, y); + path.lineTo((x + nx) / 2, y); } } else if (m_plotStyle == PlotSteps) {