IDE: revert forgotten part of r52410 #ba927319a4 - fixes IDE smart hint show/hide issues.

git-svn-id: trunk@54452 -
This commit is contained in:
ondrej 2017-03-21 19:27:04 +00:00
parent fa015f899a
commit 431b58c609

View File

@ -2023,7 +2023,14 @@ begin
FAutoHideHintTimer.Enabled := False;
if HintIsVisible then begin
Cur := Mouse.CursorPos; // Desktop coordinates
if (not IsRectEmpty(FScreenRect)) then
begin
// Do not close, if mouse still over the same word, that triggered the hint
if PtInRect(FScreenRect, Cur) then
Exit;
end else
begin
// Fallback if FScreenRect is empty (for legacy calls)
hw := CurHintWindow;
OkX := ( (FAutoHintMousePos.x <= hw.Left) and
(Cur.x > FAutoHintMousePos.x) and (Cur.x <= hw.Left + hw.Width)
@ -2040,18 +2047,9 @@ begin
) or
( (Cur.y >= hw.Top) and (Cur.y <= hw.Top + hw.Height) );
// Update FAutoHintMousePos, if outside the HintWin, and new CurPos is closer to HintWin
if OkX then FAutoHintMousePos.x := Cur.x;
if OkY then FAutoHintMousePos.y := Cur.y;
if (not IsRectEmpty(FScreenRect)) then
begin
// Do not close, if mouse still over the same word, that triggered the hint
if PtInRect(FScreenRect, Cur) then
Exit;
end else
begin
// Fallback if FScreenRect is empty
OkX := OkX or
( (FAutoHintMousePos.x <= hw.Left + MaxJitter) and
(Cur.x > FAutoHintMousePos.x - MaxJitter) and (Cur.x <= hw.Left + hw.Width + MaxJitter)