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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user