# HG changeset patch # User Chris Cannam # Date 1169482143 0 # Node ID 3ed71a9d578ba82d05ef191af458f1785a681388 # Parent 53835534a9d39c9fbd1da83d2daf3a7f181398a4 * Fix a crash in spectrogram * Don't clear background of curved area of thumbwheel (this way it looks better on a dark background) diff -r 53835534a9d3 -r 3ed71a9d578b widgets/Thumbwheel.cpp --- 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;