Use fractional point sizes in SetWindowVariant()
Don't round the scaled font size now that we can just directly use the fractional value.
This commit is contained in:
@@ -1020,22 +1020,22 @@ void wxWindowBase::DoSetWindowVariant( wxWindowVariant variant )
|
|||||||
// adjust the font height to correspond to our new variant (notice that
|
// adjust the font height to correspond to our new variant (notice that
|
||||||
// we're only called if something really changed)
|
// we're only called if something really changed)
|
||||||
wxFont font = GetFont();
|
wxFont font = GetFont();
|
||||||
int size = font.GetPointSize();
|
float size = font.GetFractionalPointSize();
|
||||||
switch ( variant )
|
switch ( variant )
|
||||||
{
|
{
|
||||||
case wxWINDOW_VARIANT_NORMAL:
|
case wxWINDOW_VARIANT_NORMAL:
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxWINDOW_VARIANT_SMALL:
|
case wxWINDOW_VARIANT_SMALL:
|
||||||
size = wxRound(size / 1.2);
|
size /= 1.2f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxWINDOW_VARIANT_MINI:
|
case wxWINDOW_VARIANT_MINI:
|
||||||
size = wxRound(size / (1.2 * 1.2));
|
size /= 1.2f * 1.2f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case wxWINDOW_VARIANT_LARGE:
|
case wxWINDOW_VARIANT_LARGE:
|
||||||
size = wxRound(size * 1.2);
|
size *= 1.2f;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@@ -1043,7 +1043,7 @@ void wxWindowBase::DoSetWindowVariant( wxWindowVariant variant )
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
font.SetPointSize(size);
|
font.SetFractionalPointSize(size);
|
||||||
SetFont(font);
|
SetFont(font);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user