Mercurial > hg > svgui
diff layer/FlexiNoteLayer.cpp @ 827:ea098f7565eb
Merge from branch tonioni
author | Chris Cannam |
---|---|
date | Fri, 18 Jul 2014 15:38:21 +0100 |
parents | 22fe9bcb7206 |
children | 5d4e3e36945f |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Thu Jul 17 14:50:31 2014 +0100 +++ b/layer/FlexiNoteLayer.cpp Fri Jul 18 15:38:21 2014 +0100 @@ -797,11 +797,10 @@ // Profiler profiler("FlexiNoteLayer::paint", true); - int x0 = rect.left(), x1 = rect.right(); - int frame0 = v->getFrameForX(x0); + int x1 = rect.right(); int frame1 = v->getFrameForX(x1); - FlexiNoteModel::PointList points(m_model->getPoints(frame0, frame1)); + FlexiNoteModel::PointList points(m_model->getPoints(0, frame1)); if (points.empty()) return; paint.setPen(getBaseQColor()); @@ -828,9 +827,12 @@ paint.save(); paint.setRenderHint(QPainter::Antialiasing, false); + int noteNumber = 0; + for (FlexiNoteModel::PointList::const_iterator i = points.begin(); i != points.end(); ++i) { + ++noteNumber; const FlexiNoteModel::Point &p(*i); int x = v->getXForFrame(p.frame); @@ -882,6 +884,11 @@ x, y + h + 2 + paint.fontMetrics().descent(), llabel, View::OutlinedText); + QString nlabel = QString("%1").arg(noteNumber); + v->drawVisibleText(paint, + x + paint.fontMetrics().averageCharWidth() / 2, + y + h/2 - paint.fontMetrics().descent(), + nlabel, View::OutlinedText); } paint.drawRect(x, y - h/2, w, h);