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.
This commit is contained in:
@@ -460,15 +460,15 @@ void wxStaticBox::PaintForeground(wxDC& dc, const RECT&)
|
|||||||
|
|
||||||
// first we need to correctly paint the background of the label
|
// first we need to correctly paint the background of the label
|
||||||
// as Windows ignores the brush offset when doing it
|
// 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 };
|
RECT dimensions = { x, 0, 0, height };
|
||||||
dimensions.left = x;
|
dimensions.left = x;
|
||||||
dimensions.right = x + width;
|
dimensions.right = x + width;
|
||||||
|
|
||||||
// need to adjust the rectangle to cover all the label background
|
// need to adjust the rectangle to cover all the label background
|
||||||
dimensions.left -= LABEL_HORZ_BORDER;
|
dimensions.left -= FromDIP(LABEL_HORZ_BORDER);
|
||||||
dimensions.right += LABEL_HORZ_BORDER;
|
dimensions.right += FromDIP(LABEL_HORZ_BORDER);
|
||||||
dimensions.bottom += LABEL_VERT_BORDER;
|
dimensions.bottom += FromDIP(LABEL_VERT_BORDER);
|
||||||
|
|
||||||
if ( UseBgCol() )
|
if ( UseBgCol() )
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user