Change fractional point size from float to double
There doesn't seem to be any compelling reason to use float. Using double is simpler, and avoids otherwise unnecessary float<->double conversions.
This commit is contained in:
@@ -91,9 +91,9 @@ void wxNativeFontInfo::Free()
|
||||
pango_font_description_free(description);
|
||||
}
|
||||
|
||||
float wxNativeFontInfo::GetFractionalPointSize() const
|
||||
double wxNativeFontInfo::GetFractionalPointSize() const
|
||||
{
|
||||
return ((float) pango_font_description_get_size( description )) / PANGO_SCALE;
|
||||
return double(pango_font_description_get_size(description)) / PANGO_SCALE;
|
||||
}
|
||||
|
||||
wxFontStyle wxNativeFontInfo::GetStyle() const
|
||||
@@ -215,7 +215,7 @@ wxFontEncoding wxNativeFontInfo::GetEncoding() const
|
||||
return wxFONTENCODING_SYSTEM;
|
||||
}
|
||||
|
||||
void wxNativeFontInfo::SetFractionalPointSize(float pointsize)
|
||||
void wxNativeFontInfo::SetFractionalPointSize(double pointsize)
|
||||
{
|
||||
pango_font_description_set_size( description, wxRound(pointsize * PANGO_SCALE) );
|
||||
}
|
||||
@@ -489,7 +489,7 @@ static wxHashTable *g_fontHash = NULL;
|
||||
|
||||
static bool wxTestFontSpec(const wxString& fontspec);
|
||||
|
||||
static wxNativeFont wxLoadQueryFont(float pointSize,
|
||||
static wxNativeFont wxLoadQueryFont(double pointSize,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
int weight,
|
||||
@@ -693,7 +693,7 @@ void wxNativeFontInfo::SetXFontName(const wxString& xFontName_)
|
||||
m_isDefault = false;
|
||||
}
|
||||
|
||||
float wxNativeFontInfo::GetFractionalPointSize() const
|
||||
double wxNativeFontInfo::GetFractionalPointSize() const
|
||||
{
|
||||
const wxString s = GetXFontComponent(wxXLFD_POINTSIZE);
|
||||
|
||||
@@ -785,7 +785,7 @@ wxFontEncoding wxNativeFontInfo::GetEncoding() const
|
||||
return wxFONTENCODING_MAX;
|
||||
}
|
||||
|
||||
void wxNativeFontInfo::SetFractionalPointSize(float pointsize)
|
||||
void wxNativeFontInfo::SetFractionalPointSize(double pointsize)
|
||||
{
|
||||
wxString s;
|
||||
if ( pointsize < 0 )
|
||||
@@ -1029,7 +1029,7 @@ bool wxTestFontEncoding(const wxNativeEncodingInfo& info)
|
||||
// X-specific functions
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
wxNativeFont wxLoadQueryNearestFont(float pointSize,
|
||||
wxNativeFont wxLoadQueryNearestFont(double pointSize,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
int weight,
|
||||
@@ -1252,7 +1252,7 @@ static bool wxTestFontSpec(const wxString& fontspec)
|
||||
}
|
||||
}
|
||||
|
||||
static wxNativeFont wxLoadQueryFont(float pointSize,
|
||||
static wxNativeFont wxLoadQueryFont(double pointSize,
|
||||
wxFontFamily family,
|
||||
wxFontStyle style,
|
||||
int weight,
|
||||
|
||||
Reference in New Issue
Block a user