# HG changeset patch # User Chris Cannam # Date 1485465508 0 # Node ID ff97318e993cc33962e0eebd096c643f15c997e2 # Parent 366ffdf719cd1c3547a61a81c9a4600563272276 Scale piano keyboard height according to text size diff -r 366ffdf719cd -r ff97318e993c layer/SpectrumLayer.cpp --- 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;