# HG changeset patch # User Chris Cannam # Date 1574431970 0 # Node ID 76e4302a3fc2e6d822113265cd3876c79f75b896 # Parent 045063dcd2bcc09120c385411dc26fda0247899c 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) diff -r 045063dcd2bc -r 76e4302a3fc2 layer/FlexiNoteLayer.cpp --- a/layer/FlexiNoteLayer.cpp Thu Nov 21 14:03:19 2019 +0000 +++ b/layer/FlexiNoteLayer.cpp Fri Nov 22 14:12:50 2019 +0000 @@ -824,15 +824,20 @@ paint.save(); paint.setRenderHint(QPainter::Antialiasing, false); - - int noteNumber = 0; + + int noteNumber = -1; for (EventVector::const_iterator i = points.begin(); i != points.end(); ++i) { - ++noteNumber; const Event &p(*i); + if (noteNumber < 0) { + noteNumber = model->getIndexForEvent(p); + } else { + noteNumber ++; + } + int x = v->getXForFrame(p.getFrame()); int y = getYForValue(v, p.getValue()); int w = v->getXForFrame(p.getFrame() + p.getDuration()) - x;