Corrected conversion of small dimensions to pixels

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74983 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart 2013-10-11 11:13:18 +00:00
parent 89c9db1e4d
commit e5510b8526

View File

@ -629,11 +629,13 @@ int wxRichTextObject::ConvertTenthsMMToPixels(int ppi, int units, double scale)
if (scale != 1.0)
pixels /= scale;
// If the result is very small, make it at least one pixel in size.
if (pixels == 0 && units > 0)
pixels = 1;
int pixelsInt = int(pixels + 0.5);
return (int) pixels;
// If the result is very small, make it at least one pixel in size.
if (pixelsInt == 0 && units > 0)
pixelsInt = 1;
return pixelsInt;
}
// Convert units in pixels to tenths of a millimetre