Mercurial > hg > svgui
diff layer/FlexiNoteLayer.cpp @ 1078:ee01a4062747 spectrogram-minor-refactor
Move drawVisibleText to PaintAssistant
author | Chris Cannam |
---|---|
date | Thu, 30 Jun 2016 12:40:22 +0100 |
parents | 5144d7185fb5 |
children | c39f2d439d59 |
line wrap: on
line diff
--- a/layer/FlexiNoteLayer.cpp Thu Jun 30 10:59:11 2016 +0100 +++ b/layer/FlexiNoteLayer.cpp Thu Jun 30 12:40:22 2016 +0100 @@ -22,12 +22,13 @@ #include "base/Pitch.h" #include "base/LogRange.h" #include "base/RangeMapper.h" + #include "ColourDatabase.h" #include "LayerGeometryProvider.h" - #include "PianoScale.h" #include "LinearNumericalScale.h" #include "LogNumericalScale.h" +#include "PaintAssistant.h" #include "data/model/FlexiNoteModel.h" @@ -869,34 +870,34 @@ // paint.setBrush(v->getForeground()); QString vlabel = QString("freq: %1%2").arg(p.value).arg(m_model->getScaleUnits()); - // v->drawVisibleText(paint, + // PaintAssistant::drawVisibleText(v, paint, // x - paint.fontMetrics().width(vlabel) - 2, // y + paint.fontMetrics().height()/2 // - paint.fontMetrics().descent(), - // vlabel, LayerGeometryProvider::OutlinedText); - v->drawVisibleText(paint, + // vlabel, PaintAssistant::OutlinedText); + PaintAssistant::drawVisibleText(v, paint, x, y - h/2 - 2 - paint.fontMetrics().height() - paint.fontMetrics().descent(), - vlabel, LayerGeometryProvider::OutlinedText); + vlabel, PaintAssistant::OutlinedText); QString hlabel = "dur: " + QString(RealTime::frame2RealTime (p.duration, m_model->getSampleRate()).toText(true).c_str()); - v->drawVisibleText(paint, + PaintAssistant::drawVisibleText(v, paint, x, y - h/2 - paint.fontMetrics().descent() - 2, - hlabel, LayerGeometryProvider::OutlinedText); + hlabel, PaintAssistant::OutlinedText); QString llabel = QString("%1").arg(p.label); - v->drawVisibleText(paint, + PaintAssistant::drawVisibleText(v, paint, x, y + h + 2 + paint.fontMetrics().descent(), - llabel, LayerGeometryProvider::OutlinedText); + llabel, PaintAssistant::OutlinedText); QString nlabel = QString("%1").arg(noteNumber); - v->drawVisibleText(paint, + PaintAssistant::drawVisibleText(v, paint, x + paint.fontMetrics().averageCharWidth() / 2, y + h/2 - paint.fontMetrics().descent(), - nlabel, LayerGeometryProvider::OutlinedText); + nlabel, PaintAssistant::OutlinedText); } paint.drawRect(x, y - h/2, w, h);