[PATCH] Improve accuracy in calculating height. The old way was just wrong.

Adam Petaccia adam at tpetaccia.com
Fri Jun 27 09:06:02 CDT 2008


---
 dlls/gdiplus/font.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c
index 86a3223..85df905 100644
--- a/dlls/gdiplus/font.c
+++ b/dlls/gdiplus/font.c
@@ -34,6 +34,7 @@ WINE_DEFAULT_DEBUG_CHANNEL (gdiplus);
 #include "gdiplus_private.h"
 
 static const REAL mm_per_pixel = 25.4;
+static const REAL points_per_inch = 1/72;
 
 static inline REAL get_dpi (void)
 {
@@ -50,7 +51,7 @@ static inline REAL get_dpi (void)
 
 static inline REAL point_to_pixel (REAL point)
 {
-    return point * 1.5;
+    return point * (get_dpi() * points_per_inch);
 }
 
 static inline REAL inch_to_pixel (REAL inch)
-- 
1.5.4.3


--=-lBU2qyX+PG1ca0Szej+T--




More information about the wine-patches mailing list