mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 07:19:18 +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
|
try
|
||||||
FreeHandle;
|
FreeHandle;
|
||||||
inherited SetSize(AValue);
|
inherited SetSize(AValue);
|
||||||
FHeight := - Round(AValue * FPixelsPerInch / 72);
|
FHeight := -MulDiv(AValue, FPixelsPerInch, 72);
|
||||||
if IsFontNameXLogicalFontDesc(Name) then
|
if IsFontNameXLogicalFontDesc(Name) then
|
||||||
Name:=ClearXLFDHeight(Name);
|
Name:=ClearXLFDHeight(Name);
|
||||||
Changed;
|
Changed;
|
||||||
@ -824,7 +824,7 @@ procedure TFont.SetHeight(Value: Integer);
|
|||||||
begin
|
begin
|
||||||
if FHeight=Value then exit;
|
if FHeight=Value then exit;
|
||||||
// set Size first. This will set FHeight to a rounded equivalent
|
// 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
|
// store the real FHeight
|
||||||
FHeight:=Value;
|
FHeight:=Value;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user