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.
This commit is contained in:
committed by
Vadim Zeitlin
parent
ef9161861d
commit
39ca664053
@@ -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
|
||||
|
@@ -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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user