mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-09 18:08:35 +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;
|
||||
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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user