From bfe11f233f7990ce8447b071a3067638100196ea Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 6 Nov 2018 03:20:24 +0100 Subject: [PATCH] Really implement wxGCDC::GetPPI() Return the DPI of the associated window, if any, instead of the hard-coded 72*72. --- src/common/dcgraph.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/common/dcgraph.cpp b/src/common/dcgraph.cpp index d70113dfcc..292d058220 100644 --- a/src/common/dcgraph.cpp +++ b/src/common/dcgraph.cpp @@ -418,6 +418,15 @@ void wxGCDCImpl::SetTextBackground( const wxColour &col ) wxSize wxGCDCImpl::GetPPI() const { + if ( m_graphicContext ) + { + wxDouble x, y; + m_graphicContext->GetDPI(&x, &y); + return wxSize(wxRound(x), wxRound(y)); + } + + // This is the same value that wxGraphicsContext::GetDPI() returns by + // default. return wxSize(72, 72); }