LCL: use muldiv to convert Font.Size to Font.Height and vice versa from Grzegorz Zakrzewski (bug #10138)

git-svn-id: trunk@12842 -
This commit is contained in:
vincents 2007-11-12 19:46:43 +00:00
parent 5b35332b64
commit f1d7bb44a0

View File

@ -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;