Skip to content

Commit

Permalink
Round alpha correctly in bilinear image scaling code too
Browse files Browse the repository at this point in the history
Add 0.5 to round the alpha values correctly too, just as it was already
done in f4c9767 for the RGB values.

Closes wxWidgets#733
  • Loading branch information
zonkx authored and vadz committed Feb 17, 2018
1 parent 23c2d67 commit ac608af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/common/image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit ac608af

Please sign in to comment.