From: Vadim Zeitlin Date: Mon, 4 Jul 2011 16:43:40 +0000 (+0000) Subject: Fix warnings about implicit double to int conversions in propgrid. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/026f3f9bc3462042f6202d6049ac9f9c196e5da8 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 --- diff --git a/src/propgrid/property.cpp b/src/propgrid/property.cpp index d0f4aa31fe..1e4f0cdfac 100644 --- a/src/propgrid/property.cpp +++ b/src/propgrid/property.cpp @@ -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