Use dedicated function to round values
This commit is contained in:
@@ -1272,13 +1272,13 @@ void wxGCDCImpl::DoGetTextExtent( const wxString &str, wxCoord *width, wxCoord *
|
|||||||
);
|
);
|
||||||
|
|
||||||
if ( height )
|
if ( height )
|
||||||
*height = (wxCoord)(h+0.5);
|
*height = (wxCoord)wxRound(h);
|
||||||
if ( descent )
|
if ( descent )
|
||||||
*descent = (wxCoord)(d+0.5);
|
*descent = (wxCoord)wxRound(d);
|
||||||
if ( externalLeading )
|
if ( externalLeading )
|
||||||
*externalLeading = (wxCoord)(e+0.5);
|
*externalLeading = (wxCoord)wxRound(e);
|
||||||
if ( width )
|
if ( width )
|
||||||
*width = (wxCoord)(w+0.5);
|
*width = (wxCoord)wxRound(w);
|
||||||
|
|
||||||
if ( theFont )
|
if ( theFont )
|
||||||
{
|
{
|
||||||
@@ -1298,7 +1298,7 @@ bool wxGCDCImpl::DoGetPartialTextExtents(const wxString& text, wxArrayInt& width
|
|||||||
|
|
||||||
m_graphicContext->GetPartialTextExtents( text, widthsD );
|
m_graphicContext->GetPartialTextExtents( text, widthsD );
|
||||||
for ( size_t i = 0; i < widths.GetCount(); ++i )
|
for ( size_t i = 0; i < widths.GetCount(); ++i )
|
||||||
widths[i] = (wxCoord)(widthsD[i] + 0.5);
|
widths[i] = wxRound(widthsD[i]);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -1348,9 +1348,9 @@ void wxGCDCImpl::DoGetSize(int *width, int *height) const
|
|||||||
wxDouble w,h;
|
wxDouble w,h;
|
||||||
m_graphicContext->GetSize( &w, &h );
|
m_graphicContext->GetSize( &w, &h );
|
||||||
if ( height )
|
if ( height )
|
||||||
*height = (int) (h+0.5);
|
*height = wxRound(h);
|
||||||
if ( width )
|
if ( width )
|
||||||
*width = (int) (w+0.5);
|
*width = wxRound(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
void wxGCDCImpl::DoGradientFillLinear(const wxRect& rect,
|
void wxGCDCImpl::DoGradientFillLinear(const wxRect& rect,
|
||||||
|
Reference in New Issue
Block a user