From 8b138202cafdf8efe581863354b574fe44d73c9f Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Sun, 23 Feb 2014 18:51:04 +0100 Subject: [PATCH] SpectrumAnalyzer: fixed spectrum painting Variable aliasing due to code style fixes introduced a regression in the darken() method. --- plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp b/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp index 2be1c355b..9854d4c86 100644 --- a/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp +++ b/plugins/SpectrumAnalyzer/SpectrumAnalyzerControlDialog.cpp @@ -33,10 +33,11 @@ static inline void darken( QImage& img, int x, int y, int w, int h ) { - QRgb * base = ( (QRgb *) img.bits() ) + y*img.width() + x; + int imgWidth = img.width(); + QRgb * base = ( (QRgb *) img.bits() ) + y*imgWidth + x; for( int y = 0; y < h; ++y ) { - QRgb * d = base + y*w; + QRgb * d = base + y*imgWidth; for( int x = 0; x < w; ++x ) { // shift each color component by 1 bit and set alpha