From f1d7bb44a07b113c54ab1214a8486394d20b8b7b Mon Sep 17 00:00:00 2001 From: vincents Date: Mon, 12 Nov 2007 19:46:43 +0000 Subject: [PATCH] LCL: use muldiv to convert Font.Size to Font.Height and vice versa from Grzegorz Zakrzewski (bug #10138) git-svn-id: trunk@12842 - --- lcl/include/font.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lcl/include/font.inc b/lcl/include/font.inc index 6d622f2ec4..e667d4c215 100644 --- a/lcl/include/font.inc +++ b/lcl/include/font.inc @@ -771,7 +771,7 @@ begin try FreeHandle; inherited SetSize(AValue); - FHeight := - Round(AValue * FPixelsPerInch / 72); + FHeight := -MulDiv(AValue, FPixelsPerInch, 72); if IsFontNameXLogicalFontDesc(Name) then Name:=ClearXLFDHeight(Name); Changed; @@ -824,7 +824,7 @@ procedure TFont.SetHeight(Value: Integer); begin if FHeight=Value then exit; // set Size first. This will set FHeight to a rounded equivalent - Size := -Round(Value*72/FPixelsPerInch); + Size := -MulDiv(Value, 72, FPixelsPerInch); // store the real FHeight FHeight:=Value; end;