Avoid -Wdouble-promotion warnings

This commit is contained in:
Paul Cornett
2020-10-14 11:07:55 -07:00
parent 97655e5b21
commit b5a554b9a6
44 changed files with 208 additions and 201 deletions

View File

@@ -1170,7 +1170,7 @@ void wxPostScriptDCImpl::SetPSFont()
}
// Select font
float size = (float)m_font.GetPointSize() * GetFontPointSizeAdjustment(DPI);
double size = m_font.GetPointSize() * double(GetFontPointSizeAdjustment(DPI));
buffer.Printf( "%s findfont %f scalefont setfont\n", name.c_str(), size * m_scaleX );
buffer.Replace( ",", "." );
PsPrint( buffer );
@@ -2253,8 +2253,8 @@ void wxPostScriptDCImpl::DoGetTextExtent(const wxString& string,
/* JC: calculate UnderlineThickness/UnderlinePosition */
m_underlinePosition = YLOG2DEVREL(int(UnderlinePosition * fontSize)) / 1000.0;
m_underlineThickness = YLOG2DEVREL(int(UnderlineThickness * fontSize)) / 1000.0;
m_underlinePosition = YLOG2DEVREL(int(UnderlinePosition * double(fontSize))) / 1000.0;
m_underlineThickness = YLOG2DEVREL(int(UnderlineThickness * double(fontSize))) / 1000.0;
}
@@ -2290,10 +2290,6 @@ void wxPostScriptDCImpl::DoGetTextExtent(const wxString& string,
}
}
double widthSum = sum;
widthSum *= fontSize;
widthSum /= 1000.0F;
/* add descender to height (it is usually a negative value) */
//if (lastDescender != INT_MIN)
//{
@@ -2304,7 +2300,7 @@ void wxPostScriptDCImpl::DoGetTextExtent(const wxString& string,
/* return size values */
if ( x )
*x = (wxCoord)widthSum;
*x = int(sum * fontSize) / 1000;
if ( y )
*y = (wxCoord)height;