changeset 1133:b4b155cfd8b4 spectrogram-minor-refactor

Fix vertical zoom/scroll in colour 3d plot layer
author Chris Cannam
date Tue, 02 Aug 2016 11:42:24 +0100
parents 745a868f0abf
children 199049012fc6
files layer/Colour3DPlotLayer.cpp layer/Colour3DPlotRenderer.cpp
diffstat 2 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/layer/Colour3DPlotLayer.cpp	Tue Aug 02 11:14:59 2016 +0100
+++ b/layer/Colour3DPlotLayer.cpp	Tue Aug 02 11:42:24 2016 +0100
@@ -666,6 +666,8 @@
     m_miny = int(lrint(min));
     m_maxy = int(lrint(max));
     
+    invalidateRenderers();
+    
     emit layerParametersChanged();
     return true;
 }
@@ -712,6 +714,8 @@
     m_maxy = m_miny + dist;
     if (m_maxy > m_model->getHeight()) m_maxy = m_model->getHeight();
 
+    invalidateRenderers();
+    
 //    SVDEBUG << "Colour3DPlotLayer::setVerticalZoomStep(" <<step <<"):  after: miny = " << m_miny << ", maxy = " << m_maxy << endl;
     
     emit layerParametersChanged();
--- a/layer/Colour3DPlotRenderer.cpp	Tue Aug 02 11:14:59 2016 +0100
+++ b/layer/Colour3DPlotRenderer.cpp	Tue Aug 02 11:42:24 2016 +0100
@@ -330,9 +330,9 @@
     const int buflen = 40;
     char labelbuf[buflen];
 
-    int minbin = 0; //!!!
-    int maxbin = sh - 1; //!!!
-    
+    int minbin = m_sources.verticalBinLayer->getIBinForY(v, h);
+    int maxbin = m_sources.verticalBinLayer->getIBinForY(v, 0) + 1;
+
     int psx = -1;
 
     vector<float> preparedColumn;