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