From 39ca664053993bbb08ad320a4a4bed60df81ca1d Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Sat, 28 Nov 2020 16:56:10 +0100 Subject: [PATCH] Improve handling of non default DPI in wxHtmlWindow deawing code This replaces the fix of f4dcac9f44 (Return wxFont adjusted to DPI in wxHtmlWinParser::CreateCurrentFont(), 2020-11-25) adjusting the font explicitly under MSW with a better fix, associating the correct window (and hence DPI) with the device context used in OnPaint(). See #18564. --- src/html/htmlwin.cpp | 1 + src/html/winpars.cpp | 4 ---- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index 4f78084b83..94f23dfa7c 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -1116,6 +1116,7 @@ void wxHtmlWindow::OnPaint(wxPaintEvent& WXUNUSED(event)) dc = &dcm; } + dc->GetImpl()->SetWindow(this); PrepareDC(*dc); // Erase the background: for compatibility, we must generate the event to diff --git a/src/html/winpars.cpp b/src/html/winpars.cpp index 830146cde0..a3f06e1d64 100644 --- a/src/html/winpars.cpp +++ b/src/html/winpars.cpp @@ -619,10 +619,6 @@ wxFont* wxHtmlWinParser::CreateCurrentFont() *encptr = m_OutputEnc; #endif } -#ifdef __WXMSW__ - if ( m_windowInterface && m_windowInterface->GetHTMLWindow() ) - (*fontptr)->WXAdjustToPPI(m_windowInterface->GetHTMLWindow()->GetDPI()); -#endif m_DC->SetFont(**fontptr); return (*fontptr); }