Refactor propgrid sample (rounding numbers).

Use wxRound function to round floating point numbers.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78402 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Artur Wieczorek 2015-01-21 17:14:22 +00:00
parent c529c68c7a
commit 9977d7daa9

View File

@ -3177,8 +3177,8 @@ void SetMinSize(wxPropertyGrid *grid)
grid->SetMinSize(size);
int proportions[3];
proportions[0] = static_cast<int>(floor((double)width[0]/size.x*100.0+0.5));
proportions[1] = static_cast<int>(floor((double)width[1]/size.x*100.0+0.5));
proportions[0] = wxRound((double)width[0]/size.x*100.0);
proportions[1] = wxRound((double)width[1]/size.x*100.0);
proportions[2]= wxMax(100 - proportions[0] - proportions[1], 0);
grid->SetColumnProportion(0, proportions[0]);
grid->SetColumnProportion(1, proportions[1]);