Skip to content

Commit

Permalink
Improve rendering on MacOS Retina/Monterey #1
Browse files Browse the repository at this point in the history
  • Loading branch information
bdbcat committed Dec 13, 2022
1 parent 9b5e78e commit 8273938
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 4 deletions.
11 changes: 9 additions & 2 deletions src/chcanv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2369,7 +2369,8 @@ void ChartCanvas::SetDisplaySizeMM(double size) {

#ifdef __WXOSX__
// Support Mac Retina displays.
max_physical /= GetContentScaleFactor();
//FIXME Monterey...fixes displayed chart_scale, and SCAMIN calcs.
//max_physical /= GetContentScaleFactor();
#endif

m_pix_per_mm = (max_physical) / ((double)m_display_size_mm);
Expand Down Expand Up @@ -11102,7 +11103,10 @@ void ChartCanvas::OnPaint(wxPaintEvent &event) {
}

if (m_brepaint_piano && g_bShowChartBar) {
m_Piano->Paint(GetClientSize().y - m_Piano->GetHeight(), mscratch_dc);
int canvas_height = GetClientSize().y;
// FIXME Monterey
canvas_height *= 2;
m_Piano->Paint(canvas_height - m_Piano->GetHeight(), mscratch_dc);
// m_brepaint_piano = false;
}

Expand Down Expand Up @@ -13083,6 +13087,9 @@ void ChartCanvas::UpdateGPSCompassStatusBox(bool b_force_new) {
wxRect rect = m_Compass->GetRect();
wxSize parent_size = GetSize();

// FIXME Monterey
parent_size *= 2;

// check to see if it would overlap if it was in its home position (upper
// right)
wxPoint tentative_pt(parent_size.x - rect.width - cc1_edge_comp,
Expand Down
10 changes: 8 additions & 2 deletions src/glChartCanvas.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2679,10 +2679,16 @@ void glChartCanvas::DrawFloatingOverlayObjects(ocpnDC &dc) {
}

void glChartCanvas::DrawChartBar(ocpnDC &dc) {
if (m_pParentCanvas->GetPiano())
if (m_pParentCanvas->GetPiano()){

int canvas_height = GetClientSize().y;
// FIXME Monterey
canvas_height *= 2;

m_pParentCanvas->GetPiano()->DrawGL(
m_pParentCanvas->GetClientSize().y -
canvas_height -
m_pParentCanvas->GetPiano()->GetHeight());
}
}

void glChartCanvas::DrawQuiting() {
Expand Down

0 comments on commit 8273938

Please sign in to comment.