changeset 608:0dba6a391760

Adjust crosshair left end position based on detail level of vertical scale
author Chris Cannam
date Mon, 30 Jan 2012 16:06:32 +0000
parents 5b72899d692b
children 5f3f5c1e23e8
files layer/SpectrogramLayer.cpp layer/SpectrogramLayer.h
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp	Mon Jan 30 16:01:59 2012 +0000
+++ b/layer/SpectrogramLayer.cpp	Mon Jan 30 16:06:32 2012 +0000
@@ -76,6 +76,7 @@
     m_normalizeVisibleArea(false),
     m_lastEmittedZoomStep(-1),
     m_synchronous(false),
+    m_haveDetailedScale(false),
     m_lastPaintBlockWidth(0),
     m_updateTimer(0),
     m_candidateFillStartFrame(0),
@@ -3031,7 +3032,7 @@
     QRect horizontal(0, cursorPos.y(), cursorPos.x(), 1);
     extents.push_back(horizontal);
 
-    int sw = getVerticalScaleWidth(v, false, paint);//!!!
+    int sw = getVerticalScaleWidth(v, m_haveDetailedScale, paint);
 
     QRect freq(sw, cursorPos.y() - paint.fontMetrics().ascent() - 2,
                paint.fontMetrics().width("123456 Hz") + 2,
@@ -3065,7 +3066,7 @@
 {
     paint.save();
 
-    int sw = getVerticalScaleWidth(v, false, paint); //!!!
+    int sw = getVerticalScaleWidth(v, m_haveDetailedScale, paint);
 
     QFont fn = paint.font();
     if (fn.pointSize() > 8) {
@@ -3487,6 +3488,8 @@
 	    py = y;
 	}
     }
+
+    m_haveDetailedScale = detailed;
 }
 
 class SpectrogramRangeMapper : public RangeMapper
--- a/layer/SpectrogramLayer.h	Mon Jan 30 16:01:59 2012 +0000
+++ b/layer/SpectrogramLayer.h	Mon Jan 30 16:06:32 2012 +0000
@@ -263,6 +263,7 @@
     int                 m_lastEmittedZoomStep;
     bool                m_synchronous;
 
+    mutable bool        m_haveDetailedScale;
     mutable int         m_lastPaintBlockWidth;
     mutable RealTime    m_lastPaintTime;