Round alpha correctly in bilinear image scaling code too

Add 0.5 to round the alpha values correctly too, just as it was already
done in f4c9767b49 for the RGB values.

Closes https://github.com/wxWidgets/wxWidgets/pull/733
This commit is contained in:
zonkx
2018-02-16 20:57:12 +01:00
committed by Vadim Zeitlin
parent 23c2d67c08
commit ac608afdfe

View File

@@ -844,7 +844,7 @@ wxImage wxImage::ResampleBilinear(int width, int height) const
dst_data += 3;
if ( src_alpha )
*dst_alpha++ = static_cast<unsigned char>(a1 * dy1 + a2 * dy);
*dst_alpha++ = static_cast<unsigned char>(a1 * dy1 + a2 * dy +.5);
}
}