Mercurial > hg > svgui
diff layer/SpectrogramLayer.cpp @ 287:cd2492c5fe45
* Add SingleColourLayer to manage colours for layers that have a single
predominant colour (i.e. most of them).
author | Chris Cannam |
---|---|
date | Thu, 12 Jul 2007 16:14:59 +0000 |
parents | 9dd432665059 |
children | c0b9eec70639 |
line wrap: on
line diff
--- a/layer/SpectrogramLayer.cpp Wed Jul 11 20:46:37 2007 +0000 +++ b/layer/SpectrogramLayer.cpp Thu Jul 12 16:14:59 2007 +0000 @@ -1021,7 +1021,7 @@ bool SpectrogramLayer::hasLightBackground() const { - return (m_colourMap == (int)ColourMapper::BlackOnWhite); + return ColourMapper(m_colourMap, 1.f, 255.f).hasLightBackground(); } void @@ -2334,7 +2334,7 @@ // std::cerr << "SpectrogramLayer: illuminate " // << x0 << "," << y1 << " -> " << x1 << "," << y0 << std::endl; - paint.setPen(Qt::white); + paint.setPen(v->getForeground()); //!!! should we be using paintCrosshairs for this? @@ -2836,11 +2836,11 @@ idb % 10 == 0) || (abs(y - lasty) > paint.fontMetrics().ascent() && idb % 5 == 0))) { - paint.setPen(Qt::black); + paint.setPen(v->getBackground()); QString text = QString("%1").arg(idb); paint.drawText(3 + cw - cbw - paint.fontMetrics().width(text), y + toff + textHeight/2, text); - paint.setPen(Qt::white); + paint.setPen(v->getForeground()); paint.drawLine(5 + cw - cbw, y, 8 + cw - cbw, y); lasty = y; lastdb = idb;