Handle all pixel values in XRC as being DPI-independent.
Pixel values in XRC can never be correct for high resolution displays, unlike the pixel values passed to wxWidgets API, which could be already adjusted to account for the resolution or obtained from resolution-dependent text metrics, so scale them by the factor appropriate for the current resolution automatically.
This commit is contained in:
@@ -2125,11 +2125,11 @@ ParseValueInPixels(wxXmlResourceHandlerImpl* impl,
|
||||
return defaultValue;
|
||||
}
|
||||
|
||||
if ( !windowToUse )
|
||||
windowToUse = impl->GetParentAsWindow();
|
||||
|
||||
if ( inDLU )
|
||||
{
|
||||
if ( !windowToUse )
|
||||
windowToUse = impl->GetParentAsWindow();
|
||||
|
||||
if ( !windowToUse )
|
||||
{
|
||||
impl->ReportParamError
|
||||
@@ -2143,6 +2143,10 @@ ParseValueInPixels(wxXmlResourceHandlerImpl* impl,
|
||||
|
||||
XRCConvertFromDLU(windowToUse, value);
|
||||
}
|
||||
else // The value is in resolution-independent pixels.
|
||||
{
|
||||
value = wxWindow::FromDIP(value, windowToUse);
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user