From 095cb950db9955b455a4f2c83f747bfbad46ad86 Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Sun, 22 Apr 2007 17:43:14 +0000 Subject: [PATCH] fix double to int conversion warning git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/imagpng.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/common/imagpng.cpp b/src/common/imagpng.cpp index 8acc531db2..bb081b809a 100644 --- a/src/common/imagpng.cpp +++ b/src/common/imagpng.cpp @@ -63,8 +63,6 @@ enum Transparency Transparency_Alpha }; -static const double INCHES_IN_METER = 39.3700787; - // ---------------------------------------------------------------------------- // local functions // ---------------------------------------------------------------------------- @@ -755,8 +753,11 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos switch ( GetResolutionFromOptions(*image, &resX, &resY) ) { case wxIMAGE_RESOLUTION_INCHES: - resX *= INCHES_IN_METER; - resY *= INCHES_IN_METER; + { + const double INCHES_IN_METER = 10000.0 / 254; + resX = int(resX * INCHES_IN_METER); + resY = int(resY * INCHES_IN_METER); + } break; case wxIMAGE_RESOLUTION_CM: -- 2.45.2