mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 13:17:18 +02:00
LCL: Remove an unused Rect from TCanvas.TextExtent. Suggested by lagprogramming.
This commit is contained in:
parent
e4a334e330
commit
79fadc1fa5
@ -1776,7 +1776,6 @@ end;
|
|||||||
function TCanvas.TextExtent(const Text: string): TSize;
|
function TCanvas.TextExtent(const Text: string): TSize;
|
||||||
var
|
var
|
||||||
DCIndex: Integer;
|
DCIndex: Integer;
|
||||||
ARect: TRect;
|
|
||||||
|
|
||||||
procedure SaveState;
|
procedure SaveState;
|
||||||
begin
|
begin
|
||||||
@ -1795,17 +1794,13 @@ begin
|
|||||||
Result.cY := 0;
|
Result.cY := 0;
|
||||||
if Text='' then exit;
|
if Text='' then exit;
|
||||||
RequiredState([csHandleValid, csFontValid]);
|
RequiredState([csHandleValid, csFontValid]);
|
||||||
|
|
||||||
DCIndex := 0;
|
DCIndex := 0;
|
||||||
if Font.IsDefault then
|
if Font.IsDefault then
|
||||||
begin
|
begin
|
||||||
SaveState;
|
SaveState;
|
||||||
SelectObject(FHandle, OnGetSystemFont());
|
SelectObject(FHandle, OnGetSystemFont());
|
||||||
end;
|
end;
|
||||||
|
|
||||||
ARect := Rect(0, 0, 0, 0);
|
|
||||||
GetTextExtentPoint(FHandle, PChar(Text), Length(Text), Result);
|
GetTextExtentPoint(FHandle, PChar(Text), Length(Text), Result);
|
||||||
|
|
||||||
RestoreState;
|
RestoreState;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user