Fix warnings about implicit double to int conversions in propgrid.

Use wxRound() instead of implicit casts to convert double to int. This not
only avoids warnings (e.g. when using g++ with -Wconversion) but also should
be (marginally) more precise.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@68153 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2011-07-04 16:43:40 +00:00
parent 47e442de38
commit 026f3f9bc3

View File

@ -24,6 +24,7 @@
#include "wx/hash.h"
#include "wx/string.h"
#include "wx/log.h"
#include "wx/math.h"
#include "wx/event.h"
#include "wx/window.h"
#include "wx/panel.h"
@ -2103,8 +2104,8 @@ void wxPGProperty::SetValueImage( wxBitmap& bmp )
// Here we use high-quality wxImage scaling functions available
wxImage img = bmp.ConvertToImage();
double scaleY = (double)maxSz.y / (double)imSz.y;
img.Rescale(((double)bmp.GetWidth())*scaleY,
((double)bmp.GetHeight())*scaleY,
img.Rescale(wxRound(bmp.GetWidth()*scaleY),
wxRound(bmp.GetHeight()*scaleY),
wxIMAGE_QUALITY_HIGH);
wxBitmap* bmpNew = new wxBitmap(img, 32);
#else