mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 13:56:05 +02:00
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:
parent
5b35332b64
commit
f1d7bb44a0
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user