Fix font size of rich wxTextCtrl when created on display with non-system DPI

Apply a zoom factor based on the active DPI and the system DPI. On the first
DPI change, revert the scaling factor.
This commit is contained in:
Maarten Bent
2019-11-07 00:48:50 +01:00
parent 4340e46b72
commit 57d054cf95
2 changed files with 58 additions and 11 deletions

View File

@@ -244,6 +244,9 @@ protected:
#if wxUSE_RICHEDIT
virtual void MSWUpdateFontOnDPIChange(const wxSize& newDPI) wxOVERRIDE;
// Apply m_richDPIscale zoom to rich control.
void MSWSetRichZoom();
// Apply the character-related parts of wxTextAttr to the given selection
// or the entire control if start == end == -1.
//
@@ -265,6 +268,10 @@ protected:
// (although not directly: 1 is for 1.0, 2 is for either 2.0 or 3.0 as we
// can't nor really need to distinguish between them and 4 is for 4.1)
int m_verRichEdit;
// Rich text controls need temporary scaling when they are created on a
// display with non-system DPI.
float m_richDPIscale;
#endif // wxUSE_RICHEDIT
// number of EN_UPDATE events sent by Windows when we change the controls