Fix minor errors in fixed/floating-point conversion.

This commit is contained in:
Carl Worth 2003-12-15 17:26:25 +00:00
parent 1cd1330aa3
commit 0095dcb49d
3 changed files with 11 additions and 12 deletions

View file

@ -1,5 +1,8 @@
2003-12-15 Carl Worth <cworth@isi.edu>
* src/cairo_ft_font.c (DOUBLE_TO_16_16): Fix minor errors in
fixed/floating-point conversion.
* src/cairoint.h: font->show_glyphs no longer accepts an offset
point.

View file

@ -40,12 +40,10 @@ typedef struct {
} cairo_ft_font_t;
#define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 63.0))
#define DOUBLE_FROM_26_6(t) (((double)((t) >> 6)) \
+ ((double)((t) & 0x3F) / 63.0))
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65535.0))
#define DOUBLE_FROM_16_16(t) (((double)((t) >> 16)) \
+ ((double)((t) & 0xFFFF) / 65535.0))
#define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 64.0))
#define DOUBLE_FROM_26_6(t) ((double)(t) / 64.0)
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0))
#define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0)
/* implement the platform-specific interface */

View file

@ -40,12 +40,10 @@ typedef struct {
} cairo_ft_font_t;
#define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 63.0))
#define DOUBLE_FROM_26_6(t) (((double)((t) >> 6)) \
+ ((double)((t) & 0x3F) / 63.0))
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65535.0))
#define DOUBLE_FROM_16_16(t) (((double)((t) >> 16)) \
+ ((double)((t) & 0xFFFF) / 65535.0))
#define DOUBLE_TO_26_6(d) ((FT_F26Dot6)((d) * 64.0))
#define DOUBLE_FROM_26_6(t) ((double)(t) / 64.0)
#define DOUBLE_TO_16_16(d) ((FT_Fixed)((d) * 65536.0))
#define DOUBLE_FROM_16_16(t) ((double)(t) / 65536.0)
/* implement the platform-specific interface */