Mercurial > hg > svgui
comparison 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 |
comparison
equal
deleted
inserted
replaced
693:81c4c44ecc10 | 697:26b1ffe412f9 |
---|---|
815 } | 815 } |
816 | 816 |
817 int | 817 int |
818 NoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const | 818 NoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const |
819 { | 819 { |
820 return 10; | 820 if (!m_model || shouldAutoAlign()) { |
821 return 0; | |
822 } else if (m_verticalScale == LogScale || | |
823 m_verticalScale == MIDIRangeScale) { | |
824 return 10; | |
825 } else { | |
826 return 0; | |
827 } | |
821 } | 828 } |
822 | 829 |
823 void | 830 void |
824 NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const | 831 NoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const |
825 { | 832 { |
826 float fmin, fmax; | 833 if (m_verticalScale == LogScale || |
827 getDisplayExtents(fmin, fmax); | 834 m_verticalScale == MIDIRangeScale) { |
828 PianoScale().paintPianoVertical | 835 float fmin, fmax; |
829 (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax); | 836 getDisplayExtents(fmin, fmax); |
830 paint.drawLine(10, 0, 10, v->height()); | 837 PianoScale().paintPianoVertical |
838 (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax); | |
839 paint.drawLine(10, 0, 10, v->height()); | |
840 } | |
831 } | 841 } |
832 | 842 |
833 void | 843 void |
834 NoteLayer::drawStart(View *v, QMouseEvent *e) | 844 NoteLayer::drawStart(View *v, QMouseEvent *e) |
835 { | 845 { |