Mercurial > hg > svgui
changeset 1231:ff97318e993c
Scale piano keyboard height according to text size
author | Chris Cannam |
---|---|
date | Thu, 26 Jan 2017 21:18:28 +0000 |
parents | 366ffdf719cd |
children | de1792daae07 |
files | layer/SpectrumLayer.cpp |
diffstat | 1 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/layer/SpectrumLayer.cpp Thu Jan 26 21:17:59 2017 +0000 +++ b/layer/SpectrumLayer.cpp Thu Jan 26 21:18:28 2017 +0000 @@ -668,10 +668,8 @@ int xorigin = getVerticalScaleWidth(v, false, paint) + 1; int w = v->getPaintWidth() - xorigin - 1; - int pkh = 0; -//!!! if (m_binScale == LogBins) { - pkh = 10; -//!!! } + int pkh = int(paint.fontMetrics().height() * 0.7 + 0.5); + if (pkh < 10) pkh = 10; paint.save(); @@ -749,9 +747,9 @@ int h = v->getPaintHeight(); // piano keyboard - //!!! should be in a new paintHorizontalScale()? - // nice to have a piano keyboard class, of course + //!!! todo: move to PianoScale::paintPianoHorizontal + paint.drawLine(xorigin, h - pkh - 1, w + xorigin, h - pkh - 1); int px = xorigin, ppx = xorigin;