Alexandre Julliard : gdi32: Store scale as an integer.
Alexandre Julliard
julliard at winehq.org
Thu Nov 5 15:37:14 CST 2020
Module: wine
Branch: master
Commit: 8768f605273c88d1041afcdd4375a87b9adb8d32
URL: https://source.winehq.org/git/wine.git/?a=commit;h=8768f605273c88d1041afcdd4375a87b9adb8d32
Author: Alexandre Julliard <julliard at winehq.org>
Date: Thu Nov 5 09:59:32 2020 +0100
gdi32: Store scale as an integer.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/gdi32/font.c | 4 ++--
dlls/gdi32/freetype.c | 4 ++--
dlls/gdi32/gdi_private.h | 2 +-
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/gdi32/font.c b/dlls/gdi32/font.c
index 300b8fc1106..6a76e28d06d 100644
--- a/dlls/gdi32/font.c
+++ b/dlls/gdi32/font.c
@@ -1698,7 +1698,7 @@ static struct gdi_font *alloc_gdi_font( const WCHAR *file, void *data_ptr, SIZE_
font->refcount = 1;
font->matrix.eM11 = font->matrix.eM22 = 1.0;
- font->scale_y = 1.0;
+ font->scale_y = 1;
font->kern_count = -1;
list_init( &font->child_fonts );
@@ -3686,8 +3686,8 @@ static struct gdi_font *select_font( LOGFONTW *lf, FMAT2 dcmat, BOOL can_use_bit
/* The jump between unscaled and doubled is delayed by 1 */
else if (scale == 2 && scaled_height - height > (face->size.height / 4 - 1)) scale--;
font->scale_y = scale;
+ TRACE("font scale y: %d\n", font->scale_y);
}
- TRACE("font scale y: %f\n", font->scale_y);
if (!font_funcs->load_font( font ))
{
diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
index c23ed714b4c..ff39ffd9541 100644
--- a/dlls/gdi32/freetype.c
+++ b/dlls/gdi32/freetype.c
@@ -2308,13 +2308,13 @@ static BOOL get_transform_matrices( struct gdi_font *font, BOOL vertical, const
width_ratio = font->scale_y;
/* Scaling transform */
- if (width_ratio != 1.0 || font->scale_y != 1.0)
+ if (width_ratio != 1.0 || font->scale_y != 1)
{
FT_Matrix scale_mat;
scale_mat.xx = FT_FixedFromFloat( width_ratio );
scale_mat.xy = 0;
scale_mat.yx = 0;
- scale_mat.yy = FT_FixedFromFloat( font->scale_y );
+ scale_mat.yy = font->scale_y << 16;
pFT_Matrix_Multiply( &scale_mat, &matrices[matrix_unrotated] );
needs_transform = TRUE;
diff --git a/dlls/gdi32/gdi_private.h b/dlls/gdi32/gdi_private.h
index 12f469af979..c5703689d46 100644
--- a/dlls/gdi32/gdi_private.h
+++ b/dlls/gdi32/gdi_private.h
@@ -335,7 +335,7 @@ struct gdi_font
LOGFONTW lf;
FMAT2 matrix;
UINT face_index;
- double scale_y;
+ INT scale_y;
INT aveWidth;
INT ppem;
SHORT yMax;
More information about the wine-cvs
mailing list