[PATCH] gdiplus: Fix errors in image dimensions.
Dmitry Timoshkov
dmitry at codeweavers.com
Thu Mar 6 01:57:32 CST 2008
"Nathan Beckmann" <nathan.beckmann at gmail.com> wrote:
> - y = (UINT)(((REAL)y) * ((REAL)GetDeviceCaps(hdcref, LOGPIXELSY)) /
> - ((REAL)INCH_HIMETRIC));
> + /* this calculation can lead to truncation error */
> + y = (UINT)((((REAL)y) * ((REAL)GetDeviceCaps(hdcref, LOGPIXELSY)) /
> + ((REAL)INCH_HIMETRIC)) + 0.5);
Using MulDiv instead should be a more appropriate fix here.
--
Dmitry.
More information about the wine-devel
mailing list