]> git.saurik.com Git - wxWidgets.git/commitdiff
fix double to int conversion warning
authorPaul Cornett <paulcor@bullseye.com>
Sun, 22 Apr 2007 17:43:14 +0000 (17:43 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Sun, 22 Apr 2007 17:43:14 +0000 (17:43 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45580 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/imagpng.cpp

index 8acc531db200c93799993c2cb59546d5f06dd702..bb081b809a5e532d0679a7854c43bdb5e7163e33 100644 (file)
@@ -63,8 +63,6 @@ enum Transparency
     Transparency_Alpha
 };
 
     Transparency_Alpha
 };
 
-static const double INCHES_IN_METER = 39.3700787;
-
 // ----------------------------------------------------------------------------
 // local functions
 // ----------------------------------------------------------------------------
 // ----------------------------------------------------------------------------
 // local functions
 // ----------------------------------------------------------------------------
@@ -755,8 +753,11 @@ bool wxPNGHandler::SaveFile( wxImage *image, wxOutputStream& stream, bool verbos
     switch ( GetResolutionFromOptions(*image, &resX, &resY) )
     {
         case wxIMAGE_RESOLUTION_INCHES:
     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:
             break;
 
         case wxIMAGE_RESOLUTION_CM: