]> git.saurik.com Git - wxWidgets.git/commitdiff
Coerce to floating point to fix ResampleBicubic. See bug #1736953.
authorRobin Dunn <robin@alldunn.com>
Mon, 18 Jun 2007 19:39:13 +0000 (19:39 +0000)
committerRobin Dunn <robin@alldunn.com>
Mon, 18 Jun 2007 19:39:13 +0000 (19:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/image.cpp

index 7abe5f9860111b5623cc2f1f66760c11f91eb8c6..6df19503b26ffa72badadeb68bd058ad8d3cead8 100644 (file)
@@ -675,13 +675,13 @@ wxImage wxImage::ResampleBicubic(int width, int height) const
     for ( int dsty = 0; dsty < height; dsty++ )
     {
         // We need to calculate the source pixel to interpolate from - Y-axis
-        double srcpixy = dsty * M_IMGDATA->m_height / height;
+        double srcpixy = double(dsty * M_IMGDATA->m_height) / height;
         double dy = srcpixy - (int)srcpixy;
 
         for ( int dstx = 0; dstx < width; dstx++ )
         {
             // X-axis of pixel to interpolate from
-            double srcpixx = dstx * M_IMGDATA->m_width / width;
+            double srcpixx = double(dstx * M_IMGDATA->m_width) / width;
             double dx = srcpixx - (int)srcpixx;
 
             // Sums for each color channel