comparison layer/FlexiNoteLayer.cpp @ 696:e77b1673e17e tonioni

Pull out log and linear vertical scales into their own classes, make some improvements to log numbering
author Chris Cannam
date Wed, 04 Dec 2013 11:35:08 +0000
parents 6d9624e0ac55
children ceb9a2992d96
comparison
equal deleted inserted replaced
695:6d9624e0ac55 696:e77b1673e17e
858 } 858 }
859 859
860 int 860 int
861 FlexiNoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const 861 FlexiNoteLayer::getVerticalScaleWidth(View *, bool, QPainter &paint) const
862 { 862 {
863 return 10; 863 if (m_verticalScale == LinearScale ||
864 m_verticalScale == AutoAlignScale) {
865 return 0;
866 } else {
867 return 10;
868 }
864 } 869 }
865 870
866 void 871 void
867 FlexiNoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const 872 FlexiNoteLayer::paintVerticalScale(View *v, bool, QPainter &paint, QRect) const
868 { 873 {
869 float fmin, fmax; 874 if (m_verticalScale == LinearScale ||
870 bool log; 875 m_verticalScale == AutoAlignScale) {
871 QString unit; 876 return;
872 if (!getValueExtents(fmin, fmax, log, unit)) return; 877 } else {
873 PianoScale().paintPianoVertical 878 float fmin, fmax;
874 (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax); 879 bool log;
875 paint.drawLine(10, 0, 10, v->height()); 880 QString unit;
881 if (!getValueExtents(fmin, fmax, log, unit)) return;
882 PianoScale().paintPianoVertical
883 (v, paint, QRect(0, 0, 10, v->height()), fmin, fmax);
884 paint.drawLine(10, 0, 10, v->height());
885 }
876 } 886 }
877 887
878 void 888 void
879 FlexiNoteLayer::drawStart(View *v, QMouseEvent *e) 889 FlexiNoteLayer::drawStart(View *v, QMouseEvent *e)
880 { 890 {