From dfba063d53b0183196f1be7c49be18840ea475d8 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 20 Dec 2017 23:01:11 +0100 Subject: [PATCH] Adjust wxMSW wxStaticBox pixel constants for DPI Use FromDIP() with all constants expressed in pixels, this should result in better appearance when using high DPI. --- src/msw/statbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/msw/statbox.cpp b/src/msw/statbox.cpp index bcc79cd1f7..167de6c152 100644 --- a/src/msw/statbox.cpp +++ b/src/msw/statbox.cpp @@ -460,15 +460,15 @@ void wxStaticBox::PaintForeground(wxDC& dc, const RECT&) // first we need to correctly paint the background of the label // as Windows ignores the brush offset when doing it - const int x = LABEL_HORZ_OFFSET; + const int x = FromDIP(LABEL_HORZ_OFFSET); RECT dimensions = { x, 0, 0, height }; dimensions.left = x; dimensions.right = x + width; // need to adjust the rectangle to cover all the label background - dimensions.left -= LABEL_HORZ_BORDER; - dimensions.right += LABEL_HORZ_BORDER; - dimensions.bottom += LABEL_VERT_BORDER; + dimensions.left -= FromDIP(LABEL_HORZ_BORDER); + dimensions.right += FromDIP(LABEL_HORZ_BORDER); + dimensions.bottom += FromDIP(LABEL_VERT_BORDER); if ( UseBgCol() ) {