LCL: Remove an unused Rect from TCanvas.TextExtent. Suggested by lagprogramming.

This commit is contained in:
Juha 2023-03-11 17:10:32 +02:00
parent e4a334e330
commit 79fadc1fa5

View File

@ -1776,7 +1776,6 @@ end;
function TCanvas.TextExtent(const Text: string): TSize;
var
DCIndex: Integer;
ARect: TRect;
procedure SaveState;
begin
@ -1795,17 +1794,13 @@ begin
Result.cY := 0;
if Text='' then exit;
RequiredState([csHandleValid, csFontValid]);
DCIndex := 0;
if Font.IsDefault then
begin
SaveState;
SelectObject(FHandle, OnGetSystemFont());
end;
ARect := Rect(0, 0, 0, 0);
GetTextExtentPoint(FHandle, PChar(Text), Length(Text), Result);
RestoreState;
end;