mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-05-04 23:28:07 +02:00
Fix minor errors in fixed/floating-point conversion.
This commit is contained in:
parent
1cd1330aa3
commit
0095dcb49d
3 changed files with 11 additions and 12 deletions
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue