1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-25 16:48:44 +02:00

Fix the bad rendering of text on OSX

The problem was because I added double buffering to reduce
flicker on Windows.  But, OSX already does its own buffering
and adding more causes text to be rendered incorrectly.

This happened a long time ago on the track panel and when
Bill gave the screenshot, my aging brain slowly remembered
the cause.
This commit is contained in:
lllucius@gmail.com 2014-10-07 23:23:40 +00:00
parent 08a3c2672c
commit 77ac0e403b

View File

@ -1125,11 +1125,19 @@ void Meter::RepaintBarsNow()
{ {
if (mLayoutValid) if (mLayoutValid)
{ {
wxClientDC dc(this); wxDC *dc;
wxBufferedDC bufDC(&dc, *mBitmap); wxClientDC clientDC(this);
#if defined(__WXMAC__)
// OSX is already double buffered and using our own buffer
// will cause text to be rendered incorrectly.
dc = &clientDC;
#else
wxBufferedDC bufDC(&clientDC, *mBitmap);
dc = &bufDC
#endif
for (int i = 0; i < mNumBars; i++) for (int i = 0; i < mNumBars; i++)
{ {
DrawMeterBar(bufDC, &mBar[i]); DrawMeterBar(*dc, &mBar[i]);
} }
} }
} }