Mercurial > hg > svgui
diff layer/NoteLayer.cpp @ 697:26b1ffe412f9
Ensure new piano scales only appear when not auto-aligning
author | Chris Cannam |
---|---|
date | Wed, 04 Dec 2013 12:17:44 +0000 |
parents | 4dcf10bd2863 |
children | 084f65094203 |
line wrap: on
line diff
--- 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