# HG changeset patch # User Chris Cannam # Date 1327939592 0 # Node ID 0dba6a391760c10c03589957099e07bb9741063d # Parent 5b72899d692b06c4b2bb9d74396eb7d9227f464b Adjust crosshair left end position based on detail level of vertical scale diff -r 5b72899d692b -r 0dba6a391760 layer/SpectrogramLayer.cpp --- 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 diff -r 5b72899d692b -r 0dba6a391760 layer/SpectrogramLayer.h --- 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;