Mercurial > hg > svgui
diff widgets/Thumbwheel.cpp @ 191:3ed71a9d578b
* Fix a crash in spectrogram
* Don't clear background of curved area of thumbwheel (this way it looks better
on a dark background)
author | Chris Cannam |
---|---|
date | Mon, 22 Jan 2007 16:09:03 +0000 |
parents | 53835534a9d3 |
children | fcc043f75c41 |
line wrap: on
line diff
--- a/widgets/Thumbwheel.cpp Mon Jan 22 15:42:00 2007 +0000 +++ b/widgets/Thumbwheel.cpp Mon Jan 22 16:09:03 2007 +0000 @@ -423,13 +423,20 @@ { Profiler profiler("Thumbwheel::paintEvent", true); + int bw = 3; + + QRect subclip; + if (m_orientation == Qt::Horizontal) { + subclip = QRect(bw, bw+1, width() - bw*2, height() - bw*2 - 2); + } else { + subclip = QRect(bw+1, bw, width() - bw*2 - 2, height() - bw*2); + } + QPainter paint(this); - paint.fillRect(rect(), palette().background().color()); + paint.fillRect(subclip, palette().background().color()); paint.setRenderHint(QPainter::Antialiasing, true); - int bw = 3; - float w = width(); float w0 = 0.5; float w1 = w - 0.5; @@ -464,12 +471,7 @@ paint.drawPath(path); } - - if (m_orientation == Qt::Horizontal) { - paint.setClipRect(QRect(bw, bw+1, width() - bw*2, height() - bw*2 - 2)); - } else { - paint.setClipRect(QRect(bw+1, bw, width() - bw*2 - 2, height() - bw*2)); - } + paint.setClipRect(subclip); float radians = m_rotation * 1.5f * M_PI;