Ignore:
Timestamp:
Oct 25, 2023, 2:23:54 PM (22 months ago)
Author:
ataylor
Message:

Small fix to positioning logic when existing window is open.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/NewView/MainForm.pas

    r487 r488  
    38283828    if WinQueryWindowPos( hTopWindow,TopHelpWindowPos ) then
    38293829    begin
    3830       // [ALT 2023-10-22] ...but only if it's fully on the screen
     3830      // [ALT 2023-10-24] ...but only if it's fully on the screen
    38313831      if ( TopHelpWindowPos.X >= 0 ) and
    3832          ( TopHelpWindowPos.X + TopHelpWindowPos.CX + Offset <= Screen.Width ) and
    3833          ( TopHelpWindowPos.Y >= 0 ) and
    3834          ( TopHelpWindowPos.Y + TopHelpWindowPos.CY + Offset <= Screen.Height )
     3832         ( TopHelpWindowPos.X + Width + Offset <= Screen.Width ) and
     3833         ( TopHelpWindowPos.Y >= Offset ) and
     3834         ( TopHelpWindowPos.Y + Height + Offset <= Screen.Height )
    38353835      then
    38363836      Begin
     
    38463846      end;
    38473847
    3848       // got the reference position, now apply the offset
    3849       Left := Left + Offset;
    3850       Bottom := Bottom - Offset;
     3848      // got the reference position, now apply the offset (but staying on screen)
     3849      if Left + Width + Offset <= Screen.Width then
     3850        Left := Left + Offset;
     3851      Bottom := Max( 0, Bottom - Offset );
    38513852
    38523853      // I guess I am leaving width/height out for compatibility...?
Note: See TracChangeset for help on using the changeset viewer.