From c3ae2fc54ad059104a6884b0d5c8d5abec794f90 Mon Sep 17 00:00:00 2001 From: JulianSmart Date: Sun, 29 Nov 2015 19:36:14 +0000 Subject: [PATCH] Use content scale factor to make wxHTML DPI-aware --- src/html/htmlwin.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/html/htmlwin.cpp b/src/html/htmlwin.cpp index d783a3e337..008b30fbb7 100644 --- a/src/html/htmlwin.cpp +++ b/src/html/htmlwin.cpp @@ -485,7 +485,12 @@ bool wxHtmlWindow::DoSetPage(const wxString& source) SetBackgroundColour(wxColour(0xFF, 0xFF, 0xFF)); SetBackgroundImage(wxNullBitmap); - m_Parser->SetDC(&dc); + double pixelScale = 1.0; +#ifndef wxHAVE_DPI_INDEPENDENT_PIXELS + pixelScale = GetContentScaleFactor(); +#endif + + m_Parser->SetDC(&dc, pixelScale, 1.0); // notice that it's important to set m_Cell to NULL here before calling // Parse() below, even if it will be overwritten by its return value as