Fix a rounding error

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78101 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2014-11-07 17:13:12 +00:00
parent df5b5baab3
commit 702e83210c

View File

@@ -703,7 +703,8 @@ bool wxRichTextFormattingDialog::ConvertFromString(const wxString& str, int& ret
float value = 0.0; float value = 0.0;
wxSscanf(str.c_str(), wxT("%f"), &value); wxSscanf(str.c_str(), wxT("%f"), &value);
// Convert from cm // Convert from cm
ret = (int) ((value * 100.0) /* + 0.5 */); float v = (value * 100.0);
ret = (int) (v);
return true; return true;
} }
else if (unit == wxTEXT_ATTR_UNITS_PERCENTAGE) else if (unit == wxTEXT_ATTR_UNITS_PERCENTAGE)
@@ -715,7 +716,8 @@ bool wxRichTextFormattingDialog::ConvertFromString(const wxString& str, int& ret
{ {
float value = 0.0; float value = 0.0;
wxSscanf(str.c_str(), wxT("%f"), &value); wxSscanf(str.c_str(), wxT("%f"), &value);
ret = (int) ((value * 100.0) /* + 0.5 */); float v = (value * 100.0);
ret = (int) (v);
} }
else if (unit == wxTEXT_ATTR_UNITS_POINTS) else if (unit == wxTEXT_ATTR_UNITS_POINTS)
{ {