1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-07 15:05:38 +01:00

Get rid of flicker when drawing the peak/rms meter.

This commit is contained in:
lllucius
2014-10-04 22:50:51 +00:00
parent 2c76f78760
commit 6ce364f2d2
2 changed files with 4 additions and 4 deletions

View File

@@ -43,6 +43,7 @@
#include <wx/defs.h>
#include <wx/dialog.h>
#include <wx/dcbuffer.h>
#include <wx/dcmemory.h>
#include <wx/image.h>
#include <wx/intl.h>
@@ -1129,9 +1130,10 @@ void Meter::RepaintBarsNow()
if (mLayoutValid)
{
wxClientDC dc(this);
wxBufferedDC bufDC(&dc, *mBitmap);
for (int i = 0; i < mNumBars; i++)
{
DrawMeterBar(dc, &mBar[i]);
DrawMeterBar(bufDC, &mBar[i]);
}
}
}
@@ -1213,7 +1215,6 @@ void Meter::DrawMeterBar(wxDC &dc, MeterBar *meterBar)
if (meterBar->vert)
{
// Calculate the peak and rms rectangles
// (+1 and -1 to not overlay the bevel)
ht = (int)(meterBar->peak * h + 0.5);
r = wxRect(x, y + h - ht, w, ht);
ht = (int)(meterBar->rms * h + 0.5);