Really implement wxGCDC::GetPPI()

Return the DPI of the associated window, if any, instead of the
hard-coded 72*72.
This commit is contained in:
Vadim Zeitlin
2018-11-06 03:20:24 +01:00
parent d5c43831b5
commit bfe11f233f

View File

@@ -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);
}