Coerce to floating point to fix ResampleBicubic. See bug #1736953.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@46531 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robin Dunn
2007-06-18 19:39:13 +00:00
parent d1b736b796
commit 993f08452d

View 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