From 4a132d8cdf0ab7e9f2d7a565f29f1beb0ecfa885 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Mon, 18 Jun 2007 19:39:13 +0000 Subject: [PATCH] Coerce to floating point to fix ResampleBicubic. See bug #1736953. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@46531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/image.cpp b/src/common/image.cpp index 181a93477c..80e2fd7c66 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -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