From a38176c67a63ce925a591f3d8514f45eccc4d27b Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 9 Jul 2018 20:36:16 +0200 Subject: [PATCH] Make wxTextCtrl horizontal margins proportional to DPI Add more FromDIP() calls. --- src/msw/textctrl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/msw/textctrl.cpp b/src/msw/textctrl.cpp index 7005edc332..ec96a10635 100644 --- a/src/msw/textctrl.cpp +++ b/src/msw/textctrl.cpp @@ -2429,7 +2429,7 @@ wxSize wxTextCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const int cx, cy; wxGetCharSize(GetHWND(), &cx, &cy, GetFont()); - DWORD wText = 1; + DWORD wText = FromDIP(1); ::SystemParametersInfo(SPI_GETCARETWIDTH, 0, &wText, 0); wText += xlen; @@ -2464,7 +2464,7 @@ wxSize wxTextCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const // stand out). if ( !HasFlag(wxBORDER_NONE) ) { - wText += 9; // borders and inner margins + wText += FromDIP(9); // borders and inner margins // we have to add the adjustments for the control height only once, not // once per line, so do it after multiplication above