comparison layer/FlexiNoteLayer.cpp @ 1553:76e4302a3fc2

Fix note numbering - ensure stable across whole track (as it used to be, but without scanning all notes in paint in order to do that)
author Chris Cannam
date Fri, 22 Nov 2019 14:12:50 +0000
parents e6362cf5ff1d
children
comparison
equal deleted inserted replaced
1552:045063dcd2bc 1553:76e4302a3fc2
822 illuminatePoint); 822 illuminatePoint);
823 } 823 }
824 824
825 paint.save(); 825 paint.save();
826 paint.setRenderHint(QPainter::Antialiasing, false); 826 paint.setRenderHint(QPainter::Antialiasing, false);
827 827
828 int noteNumber = 0; 828 int noteNumber = -1;
829 829
830 for (EventVector::const_iterator i = points.begin(); 830 for (EventVector::const_iterator i = points.begin();
831 i != points.end(); ++i) { 831 i != points.end(); ++i) {
832 832
833 ++noteNumber;
834 const Event &p(*i); 833 const Event &p(*i);
834
835 if (noteNumber < 0) {
836 noteNumber = model->getIndexForEvent(p);
837 } else {
838 noteNumber ++;
839 }
835 840
836 int x = v->getXForFrame(p.getFrame()); 841 int x = v->getXForFrame(p.getFrame());
837 int y = getYForValue(v, p.getValue()); 842 int y = getYForValue(v, p.getValue());
838 int w = v->getXForFrame(p.getFrame() + p.getDuration()) - x; 843 int w = v->getXForFrame(p.getFrame() + p.getDuration()) - x;
839 int h = NOTE_HEIGHT; //GF: larger notes 844 int h = NOTE_HEIGHT; //GF: larger notes