mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-15 01:19:29 +02:00
THintWindow.CalcHintRect: return empty rect if hint is empty
git-svn-id: trunk@38031 -
This commit is contained in:
parent
4e187f7a92
commit
b74cf37371
@ -236,10 +236,14 @@ end;
|
|||||||
function THintWindow.CalcHintRect(MaxWidth: Integer; const AHint: String;
|
function THintWindow.CalcHintRect(MaxWidth: Integer; const AHint: String;
|
||||||
AData: Pointer): TRect;
|
AData: Pointer): TRect;
|
||||||
begin
|
begin
|
||||||
|
if AHint='' then
|
||||||
|
begin
|
||||||
|
Result:=Rect(0,0,0,0);
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
if MaxWidth <= 0 then
|
if MaxWidth <= 0 then
|
||||||
MaxWidth := Screen.Width - 4 * HintBorderWidth;
|
MaxWidth := Screen.Width - 4 * HintBorderWidth;
|
||||||
Result := Rect(0, 0, MaxWidth, Screen.Height - 4 * HintBorderWidth);
|
Result := Rect(0, 0, MaxWidth, Screen.Height - 4 * HintBorderWidth);
|
||||||
if AHint='' then exit;
|
|
||||||
DrawText(Canvas.GetUpdatedHandle([csFontValid]), PChar(AHint), Length(AHint),
|
DrawText(Canvas.GetUpdatedHandle([csFontValid]), PChar(AHint), Length(AHint),
|
||||||
Result, DT_CALCRECT or DT_NOPREFIX or DT_WORDBREAK);
|
Result, DT_CALCRECT or DT_NOPREFIX or DT_WORDBREAK);
|
||||||
inc(Result.Right, 4 * HintBorderWidth);
|
inc(Result.Right, 4 * HintBorderWidth);
|
||||||
|
Loading…
Reference in New Issue
Block a user