# HG changeset patch # User Chris Cannam # Date 1468937302 -3600 # Node ID e7a07cd63d21d4d209f965bc3758ce978df97f2d # Parent ee8e73dc5c8b5873b6b7f58d65674b8a37e20ba1 Wire up invertVertical diff -r ee8e73dc5c8b -r e7a07cd63d21 layer/Colour3DPlotRenderer.cpp --- a/layer/Colour3DPlotRenderer.cpp Tue Jul 19 15:02:44 2016 +0100 +++ b/layer/Colour3DPlotRenderer.cpp Tue Jul 19 15:08:22 2016 +0100 @@ -365,6 +365,12 @@ int ry0 = m_sources.verticalBinLayer->getIYForBin(v, sy); int ry1 = m_sources.verticalBinLayer->getIYForBin(v, sy + 1); + + if (m_params.invertVertical) { + ry0 = h - ry0 - 1; + ry1 = h - ry1 - 1; + } + QRect r(rx0, ry1, rw, ry0 - ry1); float value = preparedColumn[sy - minbin]; @@ -769,9 +775,15 @@ if (!pixelPeakColumn.empty()) { for (int y = 0; y < h; ++y) { + int py; + if (m_params.invertVertical) { + py = y; + } else { + py = h - y - 1; + } m_drawBuffer.setPixel (x, - h-y-1, + py, m_params.colourScale.getPixel(pixelPeakColumn[y])); } }