Make wxTextCtrl horizontal margins proportional to DPI
Add more FromDIP() calls.
This commit is contained in:
@@ -2429,7 +2429,7 @@ wxSize wxTextCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const
|
|||||||
int cx, cy;
|
int cx, cy;
|
||||||
wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
|
wxGetCharSize(GetHWND(), &cx, &cy, GetFont());
|
||||||
|
|
||||||
DWORD wText = 1;
|
DWORD wText = FromDIP(1);
|
||||||
::SystemParametersInfo(SPI_GETCARETWIDTH, 0, &wText, 0);
|
::SystemParametersInfo(SPI_GETCARETWIDTH, 0, &wText, 0);
|
||||||
wText += xlen;
|
wText += xlen;
|
||||||
|
|
||||||
@@ -2464,7 +2464,7 @@ wxSize wxTextCtrl::DoGetSizeFromTextSize(int xlen, int ylen) const
|
|||||||
// stand out).
|
// stand out).
|
||||||
if ( !HasFlag(wxBORDER_NONE) )
|
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
|
// we have to add the adjustments for the control height only once, not
|
||||||
// once per line, so do it after multiplication above
|
// once per line, so do it after multiplication above
|
||||||
|
Reference in New Issue
Block a user