# HG changeset patch # User Chris Cannam # Date 1386159464 0 # Node ID 26b1ffe412f910fc985fb16ff2b10379390c23a5 # Parent 81c4c44ecc103ac4ca8fdb61de0d8fd4e31a3456 Ensure new piano scales only appear when not auto-aligning diff -r 81c4c44ecc10 -r 26b1ffe412f9 layer/NoteLayer.cpp --- a/layer/NoteLayer.cpp Tue Dec 03 17:56:38 2013 +0000 +++ b/layer/NoteLayer.cpp Wed Dec 04 12:17:44 2013 +0000 @@ -817,17 +817,27 @@ int NoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const { - return 10; + if (!m_model || shouldAutoAlign()) { + return 0; + } else if (m_verticalScale == LogScale || + m_verticalScale == MIDIRangeScale) { + return 10; + } else { + return 0; + } } void NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const { - float fmin, fmax; - getDisplayExtents(fmin, fmax); - PianoScale().paintPianoVertical - (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax); - paint.drawLine(10, 0, 10, v->height()); + if (m_verticalScale == LogScale || + m_verticalScale == MIDIRangeScale) { + float fmin, fmax; + getDisplayExtents(fmin, fmax); + PianoScale().paintPianoVertical + (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax); + paint.drawLine(10, 0, 10, v->height()); + } } void diff -r 81c4c44ecc10 -r 26b1ffe412f9 layer/TimeValueLayer.cpp --- a/layer/TimeValueLayer.cpp Tue Dec 03 17:56:38 2013 +0000 +++ b/layer/TimeValueLayer.cpp Wed Dec 04 12:17:44 2013 +0000 @@ -1198,6 +1198,7 @@ int TimeValueLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const { + if (!m_model || shouldAutoAlign()) return 0; int w = paint.fontMetrics().width("-000.000"); if (m_plotStyle == PlotSegmentation) return w + 20; else return w + 10;