Module: wine Branch: master Commit: 3f64708818ffce26255fed1fb350acf0d4a45567 URL: http://source.winehq.org/git/wine.git/?a=commit;h=3f64708818ffce26255fed1fb3...
Author: Michael Karcher wine@mkarcher.dialup.fu-berlin.de Date: Mon Jun 30 00:23:07 2008 +0200
gdi32: Fix double->fixpoint conversion in freetype.c.
---
dlls/gdi32/freetype.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-)
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c index 731b1c5..4fe468c 100644 --- a/dlls/gdi32/freetype.c +++ b/dlls/gdi32/freetype.c @@ -803,15 +803,12 @@ static inline BOOL is_win9x(void) return GetVersion() & 0x80000000; } /* - This function builds an FT_Fixed from a float. It puts the integer part - in the highest 16 bits and the decimal part in the lowest 16 bits of the FT_Fixed. - It fails if the integer part of the float number is greater than SHORT_MAX. + This function builds an FT_Fixed from a double. It fails if the absolute + value of the float number is greater than 32768. */ static inline FT_Fixed FT_FixedFromFloat(double f) { - short value = f; - unsigned short fract = (f - value) * 0xFFFF; - return (FT_Fixed)((long)value << 16 | (unsigned long)fract); + return f * 0x10000; }
/*