diff --git a/.gitignore b/.gitignore index de09d600d..70a795471 100644 --- a/.gitignore +++ b/.gitignore @@ -46,6 +46,7 @@ # Mac Specific .DS_Store +project.xcworkspace xcuserdata *.xcconfig mac/build diff --git a/mac/Audacity.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings b/mac/Audacity.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings deleted file mode 100644 index 08de0be8d..000000000 --- a/mac/Audacity.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEWorkspaceSharedSettings_AutocreateContextsIfNeeded - - - diff --git a/src/AudacityApp.h b/src/AudacityApp.h index 00a331a07..011307a7a 100644 --- a/src/AudacityApp.h +++ b/src/AudacityApp.h @@ -234,11 +234,13 @@ extern AudacityApp & wxGetApp(); #if defined(__WXMAC__) inline void EnableAntialiasing(wxDC & dc) { + dc.GetGraphicsContext()->EnableOffset(false); dc.GetGraphicsContext()->SetAntialiasMode(wxANTIALIAS_DEFAULT); } inline void DisableAntialiasing(wxDC & dc) { + dc.GetGraphicsContext()->EnableOffset(true); dc.GetGraphicsContext()->SetAntialiasMode(wxANTIALIAS_NONE); } diff --git a/src/widgets/Ruler.cpp b/src/widgets/Ruler.cpp index 52331c598..9e19fd1b2 100644 --- a/src/widgets/Ruler.cpp +++ b/src/widgets/Ruler.cpp @@ -136,6 +136,14 @@ Ruler::Ruler() mUserFonts = false; +#if !wxCHECK_VERSION(3, 0, 0) + #ifdef __WXMAC__ + mMinorMinorFont->SetNoAntiAliasing(true); + mMinorFont->SetNoAntiAliasing(true); + mMajorFont->SetNoAntiAliasing(true); + #endif +#endif + mMajorLabels = 0; mMinorLabels = 0; mMinorMinorLabels = 0; @@ -306,6 +314,14 @@ void Ruler::SetFonts(const wxFont &minorFont, const wxFont &majorFont, const wxF *mMinorFont = minorFont; *mMajorFont = majorFont; +#if !wxCHECK_VERSION(3, 0, 0) + #ifdef __WXMAC__ + mMinorMinorFont->SetNoAntiAliasing(true); + mMinorFont->SetNoAntiAliasing(true); + mMajorFont->SetNoAntiAliasing(true); + #endif +#endif + // Won't override these fonts mUserFonts = true; @@ -999,18 +1015,15 @@ void Ruler::Update(TimeTrack* timetrack)// Envelope *speedEnv, long minSpeed, lo desiredPixelHeight = 10;//8; if (desiredPixelHeight > 12) desiredPixelHeight = 12; -printf("desired h %d\n", desiredPixelHeight); + // Keep making the font bigger until it's too big, then subtract one. mDC->SetFont(wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD)); mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL); -printf("strW %d h %d d %d l %d\n", strW, strH, strD, strL); while ((strH - strD - strL) <= desiredPixelHeight && fontSize < 40) { fontSize++; mDC->SetFont(wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_BOLD)); mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL); -printf("size %d strW %d h %d d %d l %d\n", fontSize, strW, strH, strD, strL); } -printf("fontSize = %d\n", fontSize); fontSize--; mDC->SetFont(wxFont(fontSize, wxFONTFAMILY_SWISS, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL)); mDC->GetTextExtent(exampleText, &strW, &strH, &strD, &strL); @@ -1595,7 +1608,7 @@ void Ruler::SetUseZoomInfo(int leftOffset) // BEGIN_EVENT_TABLE(RulerPanel, wxPanel) -// EVT_ERASE_BACKGROUND(RulerPanel::OnErase) + EVT_ERASE_BACKGROUND(RulerPanel::OnErase) EVT_PAINT(RulerPanel::OnPaint) EVT_SIZE(RulerPanel::OnSize) END_EVENT_TABLE() @@ -1607,7 +1620,6 @@ RulerPanel::RulerPanel(wxWindow* parent, wxWindowID id, const wxSize& size /*= wxDefaultSize*/): wxPanel(parent, id, pos, size) { - SetBackgroundStyle(wxBG_STYLE_PAINT); } RulerPanel::~RulerPanel() @@ -1671,6 +1683,7 @@ enum { }; BEGIN_EVENT_TABLE(AdornedRulerPanel, wxPanel) + EVT_ERASE_BACKGROUND(AdornedRulerPanel::OnErase) EVT_PAINT(AdornedRulerPanel::OnPaint) EVT_SIZE(AdornedRulerPanel::OnSize) EVT_MOUSE_EVENTS(AdornedRulerPanel::OnMouseEvents) @@ -1823,7 +1836,7 @@ void AdornedRulerPanel::OnErase(wxEraseEvent & WXUNUSED(evt)) void AdornedRulerPanel::OnPaint(wxPaintEvent & WXUNUSED(evt)) { - wxAutoBufferedPaintDC dc(this); + wxBufferedPaintDC dc(this); DoDrawBorder(&dc);