From c76e5b38ae1275a9e7d879f001268e000b652252 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 8 Oct 2014 09:54:26 +0100 Subject: [PATCH] Simplify (maybe) wxPen use to see if it helps with OS X crashes (at src/osx/carbon/graphics.cpp:143). --- src/wx/audio_plot.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wx/audio_plot.cc b/src/wx/audio_plot.cc index c4e5d992f..641ddd503 100644 --- a/src/wx/audio_plot.cc +++ b/src/wx/audio_plot.cc @@ -159,7 +159,7 @@ AudioPlot::paint () gc->DrawText (std_to_wx (String::compose ("%1dB", i)), 0, y - (db_label_height / 2)); } - gc->SetPen (*wxLIGHT_GREY_PEN); + gc->SetPen (wxPen (wxColour (200, 200, 200))); gc->StrokePath (grid); gc->DrawText (_("Time"), data_width, metrics.height - metrics.y_origin + db_label_height / 2); @@ -171,7 +171,7 @@ AudioPlot::paint () plot_peak (p, c, metrics); } wxColour const col = _colours[c]; - gc->SetPen (*wxThePenList->FindOrCreatePen (wxColour (col.Red(), col.Green(), col.Blue(), col.Alpha() / 2), 1, wxPENSTYLE_SOLID)); + gc->SetPen (wxPen (wxColour (col.Red(), col.Green(), col.Blue(), col.Alpha() / 2), 1, wxPENSTYLE_SOLID)); gc->StrokePath (p); } } @@ -183,7 +183,7 @@ AudioPlot::paint () plot_rms (p, c, metrics); } wxColour const col = _colours[c]; - gc->SetPen (*wxThePenList->FindOrCreatePen (col, 1, wxPENSTYLE_SOLID)); + gc->SetPen (wxPen (col, 1, wxPENSTYLE_SOLID)); gc->StrokePath (p); } } @@ -192,7 +192,7 @@ AudioPlot::paint () axes.MoveToPoint (metrics.db_label_width, 0); axes.AddLineToPoint (metrics.db_label_width, metrics.height - metrics.y_origin); axes.AddLineToPoint (metrics.db_label_width + data_width, metrics.height - metrics.y_origin); - gc->SetPen (*wxBLACK_PEN); + gc->SetPen (wxPen (wxColour (0, 0, 0))); gc->StrokePath (axes); delete gc; -- 2.30.2